rtd.planner.trajectory.Trajectory

class rtd.planner.trajectory.Trajectory[source]

Bases: object

Base class for a parameterized trajectory

This encapsulates the conversion of parameters used in optimization to the actual trajectory generated from those parameters. This can also be used by an Objective object as part of the objective function call. It should be generated with some TrajectoryFactory

__init__()[source]

Methods

__init__()

getCommand(time)

Computes the actual state to track for the given time

setParameters(trajectoryParams, **options)

Set the parameters for the trajectory

validate([throwOnError])

Validates if the trajectory is parameterized right

abstract getCommand(time: float | NDArray[Shape[N], float64]) EntityState[source]

Computes the actual state to track for the given time

Should throw InvalidTrajectory if the trajectory isn’t set Should take Vecnp as time if vectorized is True

Parameters:

time – Time to use to calculate the desired state for this trajectory

Returns:

Desired state at the given time

Return type:

EntityState

abstract setParameters(trajectoryParams: NDArray[Shape[N], float64], **options)[source]

Set the parameters for the trajectory

This allows for the entire trajectory described to be changed, but it should focus on this trajectory params while the constructor should focus on the start state

Parameters:

trajectoryParams – the parameters of the trajectory to set

abstract validate(throwOnError: bool = False) bool[source]

Validates if the trajectory is parameterized right

A validation method to ensure that the trajectory this object describes is fully set. Has an additional argument to allow throwing an error if incorrect

Parameters:

throwOnError – bool: whether or not to throw InvalidTrajectory if invalid

Returns:

whether or not the trajectory is valid

Return type:

bool