|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Xbox Tank Drive?
How would I get the Xbox controller to work with tank drive correctly? It's a pain the team insists on using it, but oh well. Just not sure how to combine the multiple axis's into something like TankDrive.
|
|
#2
|
|||
|
|||
|
Re: Xbox Tank Drive?
I don't know if this will be useful to you, but I found this awhile back:
http://pastebin.com/fy0TMhP6 They use the 360 controller... |
|
#3
|
|||
|
|||
|
Re: Xbox Tank Drive?
Is this possible with Labview? And if so, can someone help me with this?
|
|
#4
|
|||
|
|||
|
Re: Xbox Tank Drive?
Quote:
You need to create a JoyStick object and a RobotDrive object. Then you just need to call the TankDrive() method of the RobotDrive class with the values from the left and right analog stick on the xbox controller. Should look something like this: Code:
void MySimpleRobot::OperatorControl()
{
RobotDrive* pTeleopDrive = new RobotDrive(1,2,3,4);
Joystick* pDriverXbox = new Joystick(1);
while(IsOperatorControl() && IsEnabled())
{
pTeleopDrive->TankDrive(pDriverXbox->GetRawAxis(2), pDriverXbox->GetRawAxis(5));
}
}
|
|
#5
|
||||
|
||||
|
Re: Xbox Tank Drive?
Team 2550 is using a Xbox360 controller with tank drive this year and we found some interesting things.
Mainly that the default tank and X,Y functions jump off a bridge when using a wired Xbox controller. Instead we did some testing with GetRawAxis and this is what we found: 1 - Reads -Y Values of the left thumb stick 2 - Reads ALL values of the left thumb stick 3 - Reads DPAD X values 4 - Reads X values of right thumb stick 5 - Reads X values of right bumper 6 - Reads DPAD Y values Twist - Right thumb stick X axis Throttle - Triggers (-1 is left trigger 1 is right trigger 0 is both or neither) Hope this helps, our controller is kinda funky, but it is xbox360. Your axises might be different though. |
|
#6
|
||||
|
||||
|
Re: Xbox Tank Drive?
Try using the run command (if using Windows) and search open "joy.cpl" without the parentheses. This will allow you to see what all the buttons and axis are in regards to their raw port (0, 2, etc.)
|
|
#7
|
|||
|
|||
|
Re: Xbox Tank Drive?
Team 1967 created a Janky Joystick Investigator that puts button and axis values on SmartDashboard. That way when you click a button or move a thumbstick you will be able to figure out which button number/axis that physical button or axis it corresponds to. Our team has a GitHub repository.
Here is the link to the Investigator: https://github.com/bobwolff68/FRCTea...ckInvestigator And here is the link to our full repository: https://github.com/bobwolff68/FRCTeam1967 Hope this helps! ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|