WPILib trajectory following only goes forward and doesn't stop

We are trying to implement path following using WPILib’s guide. We followed the guide closely, and believe we followed it correctly. However, whenever we enable autonomous our robot starts driving forward in a straight line and doesn’t stop until we disable. This happens the same no matter how we program the trajectory. We’ve tried both PathPlanner and WPILib’s S-shaped test trajectory, and the behavior is the same with both. We’ve checked the suggestions of WPILib’s troubleshooting page but couldn’t find anything that helped. The feedforward and kP values seem reasonable, and we have tested the odometry in tele-op mode and it outputs correct position x and y values. We are making sure that we set the speeds of the drivebase to zero after the ramsete command.

Here is our code.

Any help is appreciated.

I think you have to update your wheel speeds in your periodic method of your drive subsystem. I think that might be causing it but I’m not sure.

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