So over the past couple of days we have seen a worsening problem. We are running SDS Mk4i and have had very little problem to date. We have based our code of of 364. Here is our git repository: 5804 Charged Up
We have initialized our joysticks:
/* Controllers /
public final XboxController driver1 = new XboxController(0);
private final Joystick buttonBoard = new Joystick(1); //maybe 2 idk fix the ports
private final Joystick driver2 = new Joystick(2);
Trigger exampleTrigger = new Trigger(() → driver1.getLeftTriggerAxis() > 0.5
/ Drive Controls */
private final int translationAxis = XboxController.Axis.kLeftY.value;
private final int strafeAxis = XboxController.Axis.kLeftX.value;
private final int rotationAxis = XboxController.Axis.kRightX.value;
and then set our default Command here
() → -driver1.getRawAxis(translationAxis),
() → -driver1.getRawAxis(strafeAxis),
() → -driver1.getRawAxis(rotationAxis),
() → back1.getAsBoolean(),
() → driver1.getLeftTriggerAxis()
As you can see we are binding the strafe to the right stick x axis on the xbox controller. However over the past few days a worsening problem has started to pop up. Even though we are mapped to the x axis, when in teleop the x axis will not cause a rotation. (We had good and normal behavior prior to a couple of days ago). Instead we found that the Y axis on the right stick is now causing the rotation. (This was a random behavior that has now become more persistent.) When looking at the joystick on the driver station, moving the X axis on the joystick is seen by the driver station as the x axis and same for the y axis. Even when power cycling robot, deploying code and rebooting computer the error continues. The suddenly it is ok.
We did an experiment when we bound the right stick y axis to the rotation command. When we did this neither the x or y axis would cause the rotation.
We have also changed joysticks with no luck.
Has anyone seen any behavior like this? One thing that we did do when this started is we wrote some code for the dpad to control the swerve drive in a fine tuning way. This was done around the time the behavior started.
Any help would be appreciated.