Issues with MaxSwerve navX in java

Hi,

I would like to know if there anyone here who is using the MaxSwerve base train along with a navx and coding in java.
here is a picture of the robot:
robot1

We’ve been testing our MaxServe lately using NavX as a gyro. Unfortunately, we have some issues.

Here is the video showing the robot behavior:
https://www.youtube.com/watch?v=JK6dexNONMo

On the image attached (robot1), the red arrow indicates the front of the robot. On the video, and based on the time line: From 0 to 29 seconds, the robot moves properly meaning it can go forward, backward, left and right as expected.
From 29 seconds to 33 seconds, the robot is rotated 90 degrees to the right (regarding the back of the robot), at that point when pushing the joystick in the forward direction the robot moves in the backwards direction as seen from 38 seconds to 40 seconds. From 41 seconds to 44 seconds, the joystick is pushed backwards and the robot moves in the forward direction. From 44 seconds to 47 seconds the joystick is pushed in the right direction but the robot moves in the left direction and from 47 seconds to 53 seconds the joystick is pushed in the left direction and the robot moves in the right direction.
From 53 seconds to 58 seconds, the robot is rotated 90 to the right again, the robot then moves according to the expected behavior going left, right, back, front according to the joystick direction. From 1:15 to 1:18, the robot is rotated again by 90 degrees to the right and then the robot moves left when it should right, forwards when it should move backwards.

We use the MaxSwerve java template with a Navx as gyro. I would like to know if you have some advice.

Thank you

Try this – i think this is what our programming team did to fix our problem.

1 Like

Hi @drwaters,

Thank you for your quick feedback.
Have a nice day!

1 Like