How do you set up points at which to decelerate in a ramsete command?

Hi guys, for one autonomous routine, my team wants the robot to start decelerating during a path after reaching a certain point. Is this possible?

I’m not aware of an easy way, but when you create the trajectory with the WPILIB TrajectoryGenerator, you can pass a TrajectoryConfig. To that one you can add one or more TrajectoryConstraints. When you implement a TrajectoryConstraint, one of the methods is getMaxVelocityMetersPerSecond(Pose2d poseMeters, .... So in there you can check the current poseMeters and depending on where you are return a faster or slower speed, i.e. you can determine what speed you want to allow at each position.

3 Likes

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