Drive routines for Autonomous need to be defined as points on the field with rotation headers. Those are the data points for the Trajectory.
Trajectory exampleTrajectory = TrajectoryGenerator.generateTrajectory(
// Start at the origin facing the +X direction
new Pose2d(0, 0, new Rotation2d(0)),
// Pass through these two interior waypoints, making an 's' curve path
List.of(
new Translation2d(1, 1),
new Translation2d(2, -1)
),
// End 3 meters straight ahead of where we started, facing forward
new Pose2d(3, 0, new Rotation2d(0)),
// Pass config
config
);
For each of our Auto routines, define the x, y and rotation of each of the points in the Trajectory. Units of measures - meters, and degrees.
Drive routines for Autonomous need to be defined as points on the field with rotation headers. Those are the data points for the Trajectory.
For each of our Auto routines, define the x, y and rotation of each of the points in the Trajectory. Units of measures - meters, and degrees.