The eight steps
Something is wrong but it's driving-ish?
When the inversion state changes do not work and nothing else you know of fixes your issue's the debugging of such setups can be painful and arduous. Here are the eight steps that are unfortunately necessary to accomplish debugging this.
Affectionally known as "Translational Axis change based off of the robot heading" (the X and Y axis change in field oriented based off your robot turning.) these steps will resolve it somewhere along the way.
Prepare your robot code.
In order for these tests to be conducted quickly and effectively please use the following or a variation of the following as your drive code. You may need to port it to a joystick or negate the axis' data retrieved but this will help you debug your issues faster.
This snippet is taken directly from the YAGSL-Example project, if you are using that project you just need to be sure you use driveFieldOrientedDirectAngle
as the default command for the SwerveSubsystem
and correct any joystick inversions necessary.
The eight steps.
The steps are dangerous!
6 of them will cause your robot to spin out of control.
1 of them will be correct.
1 of them will appear to be correct but have the translational axis change based off of the robot heading.
You are not expected to complete all of these steps to achieve a functioning swerve drive, somewhere along the way your issue should disappear.
Start by setting
invertIMU
inswervedrive.json
tofalse
AND thedrive
invert
tofalse
in module JSONs.THEN set
invertIMU
totrue
.THEN invert all of the drive motors in the module JSONs by setting them to
true
.THEN set
invertIMU
tofalse
.THEN .\
THEN uninvert all of the drive motors by setting them to
false
THEN set
invertIMU
totrue
.THEN set your drive motors inversion states to
true
.
IF none of these work you most likely have a incorrect hardware configuration, something is not working as expected, or something is wired incorrectly.
Verifying behaviour
Sometimes the 8 steps doesnt look like its done when it really is. Here is an example on which the bot is actually tuned correctly but the desired front of the robot is really the back of the robot.
Last updated