Problems with RamseteCommand and trajectories

I’m currently looking into the RamseteCommand provided by WPI and I’m running into two issues.

The first one is that Pose2d isn’t displaying the correct distance. I put the pose on smartdashboard as well as my distance calculation (both are in meters), and for some reason the pose (x,y) is significantly smaller than the distance calculated I copied the m_odometry.update(angle,leftDistance,rightDistance) from here (changing it to fit my robot). It follows a “go forward” trajectory fine; however, anything more complex such as going any distance after a turn goes on forever.

The second problem is that it doesn’t really turn and I have no idea why. All of my values are based on the FRC characterization tool or direct measurement so I don’t think those are the problem. For example, if I make a trajectory {0,0,0} to {1,1, Pi/4}, it just goes straight 1 meter.

Our github repository is here.

Thanks in advance for the help.

Before trying to figure out why the controller is not working you need to fix your issue with the odometry. Have you made sure that your encoders’ .getDistance() method is returning in meters the wheel has traveled? Are both of them positive when you move forward? (this is likely the issue, it explains the tiny pose increase that you notice comparatively.)

Another thing I noticed is that your voltage constraint is very small at 10 volts. 12 is a more reasonable constraint.

10 volts is a better constraint than 12; you want to provide some headroom to account for voltage sag and battery drain.

Yes, that was the issue. It is fixed now. Thank you so much!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.