HolonomicTrajectory

class wpimath.HolonomicTrajectory(samples: collections.abc.Sequence[wpimath._wpimath.HolonomicSample])

Bases: HolonomicTrajectoryBase

A trajectory for holonomic (omni-directional) drive robots.

Uses constant-acceleration kinematic interpolation between samples.

Constructs a HolonomicTrajectory from a vector of samples.

Parameters:

samples – The samples of the trajectory. Order does not matter as they will be sorted internally. @throws std::invalid_argument if the vector of samples is empty.

concatenate(other: wpimath._wpimath.HolonomicTrajectory) wpimath._wpimath.HolonomicTrajectory

Concatenates another trajectory to this trajectory.

Parameters:

other – The trajectory to concatenate.

Returns:

The concatenated trajectory.

interpolate(start: wpimath._wpimath.HolonomicSample, end: wpimath._wpimath.HolonomicSample, t: SupportsFloat | SupportsIndex) wpimath._wpimath.HolonomicSample

Interpolates between two samples using kinematic interpolation.

Parameters:
  • start – The starting sample.

  • end – The ending sample.

  • t – The interpolation parameter between 0 and 1.

Returns:

The interpolated sample.

relative_to(pose: wpimath._wpimath.Pose2d) wpimath._wpimath.HolonomicTrajectory

Transforms all poses so they are relative to the given pose.

Parameters:

pose – The pose to make the trajectory relative to.

Returns:

The transformed trajectory.

transform_by(transform: wpimath._wpimath.Transform2d) wpimath._wpimath.HolonomicTrajectory

Transforms all poses in the trajectory by the given transform.

Parameters:

transform – The transform to apply to the poses.

Returns:

The transformed trajectory.