|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Getting Rotation to work with XBOX 360 controller
Hello all
So our team is programming in java and we are having trouble getting the robot to turn/rotate. We are using a XBOX Controller and using the left stick to go forward and strafe and the right stick for turning/rotation. The left stick functions perfectly but the right stick has issues. When the right stick is moved around, the robot starts to rotate but then will stop. It never completes a rotation fully. We are using mecanum. Here is our code so far: Code:
while (isOperatorControl()&&isEnabled()) {
double leftXAxis=xboxController.getRawAxis(1);
double leftYAxis=xboxController.getRawAxis(2);
chassis.mecanumDrive_Cartesian(leftXAxis, leftYAxis, xboxController.getRawAxis(4),0);
Thanks Last edited by TheLegion : 26-01-2015 at 23:22. |
|
#2
|
||||
|
||||
|
Re: Getting Rotation to work with XBOX 360 controller
Quote:
What output is produced when you print Code:
joystick.getRawAxis(4); |
|
#3
|
|||
|
|||
|
Re: Getting Rotation to work with XBOX 360 controller
Yeah, the output does correspond to the range of -1 to 1. When we move the right analog stick, some of the wheels don't move in the right direction, but when we strafe or go forwards and backwards, the wheels work perfectly fine.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|