I’m using the example code in YAGSL to follow a path. The path is followed but the robot seemingly stops rotating once it reaches the correct translation.
Here is the driveToPose method:
public Command driveToPose(Pose2d pose)
{
// Create the constraints to use while pathfinding
PathConstraints constraints = new PathConstraints(
swerveDrive.getMaximumVelocity(), 4.0,
swerveDrive.getMaximumAngularVelocity(), Units.degreesToRadians(720));
// Since AutoBuilder is configured, we can use it to build pathfinding commands
return AutoBuilder.pathfindToPose(
pose,
constraints,
0.0, // Goal end velocity in meters/sec
0.0 // Rotation delay distance in meters. This is how far the robot should travel before attempting to rotate.
);
}
Here are the two ways I’m calling it:
drivetrain.driveToPose(
new Pose2d(
new Translation2d(
0,
0
),
new Rotation2d(
Math.PI
)
)
)
drivetrain.driveToPose(
new Pose2d(
new Translation2d(
1,
0
),
new Rotation2d(
Math.PI
)
)
)
The first one, with just rotation and no translation2D, the robot doesn’t do anything. The second one, the robot moves to the translation and rotates but once it reaches the right translation, it stops rotating and doesn’t fully reach PI in rotation.
Is there some kind of option somewhere for me to tick to have the robot continue to rotate or am I using the library wrong, or is it something else?
Thanks in advance!