Choreo Interop
PathPlannerLib has the ability to follow trajectories generated by Choreo. These can either be followed as a single path, or used in auto routines created in the GUI.
Choreo Autos
No code changes are needed when using Choreo trajectories in auto modes created through the GUI. See Build an Auto for configuration and use of AutoBuilder/PathPlannerAuto.
Load Choreo Trajectory as a PathPlannerPath
Choreo trajectories can be loaded as a PathPlannerPath
similarly to how normal paths are created. Instead of using the fromPathFile
method, use fromChoreoTrajectory
with the name of the Choreo trajectory to load (without directories or the .traj extension).
See Follow a Single Path for how to create a path following command to follow the loaded trajectory.
// Load a full Choreo trajectory as a PathPlannerPath
PathPlannerPath exampleChoreoTraj = PathPlannerPath.fromChoreoTrajectory("Example Choreo Traj");
// Load a split Choreo trajectory as a PathPlannerPath, using the split point with index 1
PathPlannerPath exampleChoreoTrajSplit = PathPlannerPath.fromChoreoTrajectory("Example Choreo Traj", 1);
#incluce <pathplanner/lib/path/PathPlannerPath.h>
using namespace pathplanner;
// Load a full Choreo trajectory as a PathPlannerPath
auto exampleChoreoTraj = PathPlannerPath::fromChoreoTrajectory("Example Choreo Traj");
// Load a split Choreo trajectory as a PathPlannerPath, using the split point with index 1
auto exampleChoreoTrajSplit = PathPlannerPath::fromChoreoTrajectory("Example Choreo Traj", 1);
from pathplannerlib.path import PathPlannerPath
# Load a full Choreo trajectory as a PathPlannerPath
exampleChoreoTraj = PathPlannerPath.fromChoreoTrajectory('Example Choreo Traj')
# Load a split Choreo trajectory as a PathPlannerPath, using the split point with index 1
exampleChoreoTrajSplit = PathPlannerPath.fromChoreoTrajectory('Example Choreo Traj', 1)
Last modified: 28 November 2024