I am trying to learn how to use and modify the ramsete example code to create custom trajectories.
I seem to be able to run the code without issue if my start end end rotation is zero or very small 45 degrees or less. It seems that if I try to make larger turns when I try to run the code I get an error that kills my robot code.
The following is the error that appears in the log.
It acts like the error is with motor safety, but it doesn’t show up when I have paths that start and end with 0 rotation.
This works fine.
Rotation2d startRot = new Rotation2d(0);
Rotation2d endRot = Rotation2d.fromDegrees(0);//positive turns left // An example trajectory to follow. All units in meters. final Trajectory exampleTrajectory = TrajectoryGenerator.generateTrajectory( // Start at the origin facing the +X direction new Pose2d(0, 0, startRot), // Pass through these two interior waypoints, making an 's' curve path List.of(new Translation2d(0.1, 0.0) ), // End 3 meters straight ahead of where we started, facing forward new Pose2d(0.5, 0, endRot), // Pass config config);
But if I change the trajectory to this it will crash.
Rotation2d startRot = new Rotation2d(0); Rotation2d endRot = Rotation2d.fromDegrees(90);//positive turns left
Any help would be appreciated.
Also if anyone has examples of how to implement this and place the command where it is not in the robotContainer like the example I would like to see how that works.