TrajectorySample
- class wpimath.TrajectorySample(*args, **kwargs)
Bases:
pybind11_objectRepresents a single sample in a trajectory.
Overloaded function.
__init__(self: wpimath._wpimath.TrajectorySample) -> None
Constructs a default TrajectorySample with all zero values.
__init__(self: wpimath._wpimath.TrajectorySample, time: wpimath.units.seconds, p: wpimath._wpimath.Pose2d, v: wpimath._wpimath.ChassisVelocities, a: wpimath._wpimath.ChassisAccelerations) -> None
Constructs a TrajectorySample.
- Parameters:
time – The timestamp of the sample relative to the trajectory start.
p – The robot pose at this sample (in the field reference frame).
v – The robot velocity at this sample (in the field reference frame).
a – The robot acceleration at this sample (in the field reference frame).
- relative_to(other: wpimath._wpimath.Pose2d) wpimath._wpimath.TrajectorySample
Transforms this sample to be relative to the given pose.
- Parameters:
other – The pose to make this sample relative to.
- Returns:
A new sample with the relative pose.
- transform(transform: wpimath._wpimath.Transform2d) wpimath._wpimath.TrajectorySample
Transforms the pose of this sample by the given transform.
- Parameters:
transform – The transform to apply to the pose.
- Returns:
A new sample with the transformed pose.
- with_new_timestamp(new_timestamp: wpimath.units.seconds) wpimath._wpimath.TrajectorySample
Creates a new sample with the given timestamp.
- Parameters:
new_timestamp – The new timestamp.
- Returns:
A new sample with the given timestamp.