Trajectory
pathplannerlib Index / Pathplannerlib / Trajectory
Auto-generated documentation for pathplannerlib.trajectory module.
PathPlannerTrajectory
Show source in trajectory.py:151
Signature
class PathPlannerTrajectory:
def __init__(
self,
path: Union[PathPlannerPath, None],
starting_speeds: Union[ChassisSpeeds, None],
starting_rotation: Union[Rotation2d, None],
config: Union[RobotConfig, None],
states: List[PathPlannerTrajectoryState] = None,
events: List[Event] = None,
): ...
See also
PathPlannerTrajectory().flip
Show source in trajectory.py:380
Flip this trajectory for the other side of the field, maintaining a blue alliance origin
Returns
This trajectory with all states flipped to the other side of the field
Signature
PathPlannerTrajectory().getEndState
Show source in trajectory.py:325
Get the end state of the trajectory
Returns
The end state
Signature
See also
PathPlannerTrajectory().getEvents
Show source in trajectory.py:292
Get all the events to run while following this trajectory
Returns
Events in this trajectory
Signature
PathPlannerTrajectory().getInitialPose
Show source in trajectory.py:341
Get the initial robot pose at the start of the trajectory
Returns
Pose of the robot at the initial state
Signature
PathPlannerTrajectory().getInitialState
Show source in trajectory.py:317
Get the initial state of the trajectory
Returns
The initial state
Signature
See also
PathPlannerTrajectory().getState
Show source in trajectory.py:308
Get the goal state at the given index
Arguments
index
- Index of the state to get
Returns
The state at the given index
Signature
See also
PathPlannerTrajectory().getStates
Show source in trajectory.py:300
Get all of the pre-generated states in the trajectory
Returns
List of all states
Signature
See also
PathPlannerTrajectory().getTotalTimeSeconds
Show source in trajectory.py:333
Get the total run time of the trajectory
Returns
Total run time in seconds
Signature
PathPlannerTrajectory().sample
Show source in trajectory.py:349
Get the target state at the given point in time along the trajectory
Arguments
time
- The time to sample the trajectory at in seconds
Returns
The target state
Signature
See also
PathPlannerTrajectoryState
Show source in trajectory.py:28
Signature
PathPlannerTrajectoryState().copyWithTime
Show source in trajectory.py:128
Copy this state and change the timestamp
Arguments
time
- The new time to use
Returns
Copied state with the given time
Signature
PathPlannerTrajectoryState().flip
Show source in trajectory.py:112
Flip this trajectory state for the other side of the field, maintaining a blue alliance origin
Returns
This trajectory state flipped to the other side of the field
Signature
PathPlannerTrajectoryState().interpolate
Show source in trajectory.py:42
Interpolate between this state and the given state
Arguments
end_val
- PathPlannerTrajectoryState to interpolate witht
- Interpolation factor (0.0-1.0)
Returns
Interpolated state
Signature
def interpolate(
self, end_val: PathPlannerTrajectoryState, t: float
) -> PathPlannerTrajectoryState: ...
PathPlannerTrajectoryState().reverse
Show source in trajectory.py:95
Get the state reversed, used for following a trajectory reversed with a differential drivetrain
Returns
The reversed state
Signature
SwerveModuleTrajectoryState
Show source in trajectory.py:17