mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Sync Java and C++ trajectories in sim example (#3081)
This also shifts the trajectory up and to the right so that the robot is always visible in the Field GUI during traversal. Some drive constants and trajectory constraints were also synced between the two languages.
This commit is contained in:
committed by
GitHub
parent
64e72f7103
commit
42c3d52863
@@ -69,12 +69,12 @@ frc2::Command* RobotContainer::GetAutonomousCommand() {
|
||||
|
||||
// An example trajectory to follow. All units in meters.
|
||||
auto exampleTrajectory = frc::TrajectoryGenerator::GenerateTrajectory(
|
||||
// Start at the origin facing the +X direction
|
||||
frc::Pose2d(),
|
||||
// Start at (1, 2) facing the +X direction
|
||||
frc::Pose2d(1_m, 2_m, 0_deg),
|
||||
// Pass through these two interior waypoints, making an 's' curve path
|
||||
{frc::Translation2d(1_m, 1_m), frc::Translation2d(2_m, -1_m)},
|
||||
{frc::Translation2d(2_m, 3_m), frc::Translation2d(3_m, 1_m)},
|
||||
// End 3 meters straight ahead of where we started, facing forward
|
||||
frc::Pose2d(3_m, 0_m, 0_deg),
|
||||
frc::Pose2d(4_m, 2_m, 0_deg),
|
||||
// Pass the config
|
||||
config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user