While running path following, we have been running into an issue where the robot has been turning in a direction and then following the path while driving backwards. A video of this issue can be seen here:
So far, we have tried:
Ensuring robot odometry is reset in AutonomousInit
Attempting paths of different shapes and directions, all of them lead to this behavior
Are the start and end headings of your trajectory wrong?
Potentially? I was under the impression that the robot set its initial heading to the first heading defined by the trajectory and our test path should have an initial heading of zero, but it could definitely be an issue if it’s not.
Is your robot’s gyro getting reset to the wrong heading?
I’ve checked, it resets to zero unless we’re putting the wrong value on SmartDashboard or somehow sending the compass-based heading to our path following.
Do you have the reverse flag set incorrectly?
Fairly certain it’s not, unless this is separate from the PathWeaver reverse flag.
Are your gyro angles clockwise positive? If so, you should negate them.
Potentially. We will check this tonight.
Edit: I can confirm gyro angles are going the right way.
Thank you for passing on those troubleshooting steps. Despite the issues we’ve been having, we’re grateful to the WPILib team’s work over the past few years to introduce more advanced controls into FRC over the past few years.
Edit: We got it working, at least at the beginning. We had to flip the left side of the drivetrain in the DriveByVolts function. Still having a strange turning thing happen at the end of the path, but this might be an issue with the path.