Skip to content

tesseract_robotics.time_parameterization

Time parameterization: the algorithms (time-optimal trajectory generation, iterative spline parameterization, constant TCP speed, Ruckig smoothing) and the profiles that configure them in the TimeParameterization task composer nodes. InstructionsTrajectory is the view of a CompositeInstruction the algorithms consume; it raises StaleTrajectoryError when the program changed under it. The Task Composer User Guide covers the pipelines that run them.

Reference

tesseract_time_parameterization Python bindings

StaleTrajectoryError

Bases: RuntimeError

The program changed after the InstructionsTrajectory was built; build a new one.

InstructionsTrajectory

__init__

Python
__init__(program: CompositeInstruction) -> None

Build a trajectory view over the move instructions of program.

The trajectory keeps program alive and reads and writes its waypoints in place (setData changes program). Once instructions are appended, inserted or erased in program, every method raises StaleTrajectoryError: build a new trajectory. Each call re-flattens program, O(number of instructions).

Raises:

Type Description
StaleTrajectoryError

on any method call after program changed (a RuntimeError).

IndexError

an index method got i outside [0, size()); negative i is not wrapped.

getPosition

Python
getPosition(i: int) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]

Joint positions of waypoint i.

getVelocity

Python
getVelocity(i: int) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]

Joint velocities of waypoint i.

getAcceleration

Python
getAcceleration(i: int) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]

Joint accelerations of waypoint i.

getTimeFromStart

Python
getTimeFromStart(i: int) -> float

Time of waypoint i from the start [s].

setData

Python
setData(i: int, velocity: Annotated[NDArray[float64], dict(shape=(None,), order=C)] | Sequence[float], acceleration: Annotated[NDArray[float64], dict(shape=(None,), order=C)] | Sequence[float], time: float) -> None

Write velocity, acceleration and time from start [s] into waypoint i.

size

Python
size() -> int

The number of waypoints.

dof

Python
dof() -> int

The number of joints per waypoint.

empty

Python
empty() -> bool

True if there is no waypoint.

isTimeStrictlyIncreasing

Python
isTimeStrictlyIncreasing() -> bool

True if every waypoint's time is above the previous one's.

TimeOptimalTrajectoryGenerationCompositeProfile

Bases: Profile

override_limits property writable

Python
override_limits: bool

Use velocity_limits / acceleration_limits (/ jerk_limits) instead of the joint group's.

velocity_limits property writable

Python
velocity_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) velocity limits [m/s or rad/s], used when override_limits.

acceleration_limits property writable

Python
acceleration_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) acceleration limits [m/s² or rad/s²], used when override_limits.

max_velocity_scaling_factor property writable

Python
max_velocity_scaling_factor: float

Fraction of the velocity limits to plan with, in (0, 1].

max_acceleration_scaling_factor property writable

Python
max_acceleration_scaling_factor: float

Fraction of the acceleration limits to plan with, in (0, 1].

path_tolerance property writable

Python
path_tolerance: float

How far the path may deviate from the waypoints where TOTG blends them [rad or m, joint space].

min_angle_change property writable

Python
min_angle_change: float

Smallest direction change [rad] TOTG treats as a corner to blend.

__hash__ class-attribute instance-attribute

Python
__hash__: None = None

createKey staticmethod

Python
createKey() -> int

The key every profile of this class carries in a ProfileDictionary.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

IterativeSplineParameterizationCompositeProfile

Bases: Profile

add_points property writable

Python
add_points: bool

Add points between the first two and the last two waypoints for smoother start and end.

override_limits property writable

Python
override_limits: bool

Use velocity_limits / acceleration_limits (/ jerk_limits) instead of the joint group's.

velocity_limits property writable

Python
velocity_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) velocity limits [m/s or rad/s], used when override_limits.

acceleration_limits property writable

Python
acceleration_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) acceleration limits [m/s² or rad/s²], used when override_limits.

max_velocity_scaling_factor property writable

Python
max_velocity_scaling_factor: float

Fraction of the velocity limits to plan with, in (0, 1].

max_acceleration_scaling_factor property writable

Python
max_acceleration_scaling_factor: float

Fraction of the acceleration limits to plan with, in (0, 1].

minimum_time_delta property writable

Python
minimum_time_delta: float

Smallest time step between waypoints [s].

__hash__ class-attribute instance-attribute

Python
__hash__: None = None

createKey staticmethod

Python
createKey() -> int

The key every profile of this class carries in a ProfileDictionary.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

IterativeSplineParameterizationMoveProfile

Bases: Profile

max_velocity_scaling_factor property writable

Python
max_velocity_scaling_factor: float

Fraction of the velocity limits to plan with, in (0, 1].

max_acceleration_scaling_factor property writable

Python
max_acceleration_scaling_factor: float

Fraction of the acceleration limits to plan with, in (0, 1].

__hash__ class-attribute instance-attribute

Python
__hash__: None = None

createKey staticmethod

Python
createKey() -> int

The key every profile of this class carries in a ProfileDictionary.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

TimeParameterization

getName

Python
getName() -> str

The name this parameterization registers its profiles under.

compute

Python
compute(composite_instruction: CompositeInstruction, env: Environment, profiles: ProfileDictionary) -> bool

TimeOptimalTrajectoryGeneration

Bases: TimeParameterization

__init__

Python
__init__(name: str = 'TOTG') -> None

IterativeSplineParameterization

Bases: TimeParameterization

__init__

Python
__init__(name: str = 'ISP') -> None

ConstantTCPSpeedParameterizationCompositeProfile

Bases: Profile

max_translational_velocity property writable

Python
max_translational_velocity: float

TCP speed limit [m/s].

max_rotational_velocity property writable

Python
max_rotational_velocity: float

TCP angular speed limit [rad/s].

max_translational_acceleration property writable

Python
max_translational_acceleration: float

TCP acceleration limit [m/s²].

max_rotational_acceleration property writable

Python
max_rotational_acceleration: float

TCP angular acceleration limit [rad/s²].

max_velocity_scaling_factor property writable

Python
max_velocity_scaling_factor: float

Fraction of the velocity limits to plan with, in (0, 1].

max_acceleration_scaling_factor property writable

Python
max_acceleration_scaling_factor: float

Fraction of the acceleration limits to plan with, in (0, 1].

__hash__ class-attribute instance-attribute

Python
__hash__: None = None

createKey staticmethod

Python
createKey() -> int

The key every profile of this class carries in a ProfileDictionary.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

ConstantTCPSpeedParameterization

Bases: TimeParameterization

__init__

Python
__init__(name: str = 'ConstantTCPSpeed') -> None

RuckigTrajectorySmoothingCompositeProfile

Bases: Profile

duration_extension_fraction property writable

Python
duration_extension_fraction: float

Fraction by which each retry stretches the segment durations.

max_duration_extension_factor property writable

Python
max_duration_extension_factor: float

Largest total stretch before smoothing gives up.

override_limits property writable

Python
override_limits: bool

Use velocity_limits / acceleration_limits (/ jerk_limits) instead of the joint group's.

velocity_limits property writable

Python
velocity_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) velocity limits [m/s or rad/s], used when override_limits.

acceleration_limits property writable

Python
acceleration_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) acceleration limits [m/s² or rad/s²], used when override_limits.

jerk_limits property writable

Python
jerk_limits: Annotated[NDArray[float64], dict(shape=(None, 2), order=F)]

Per-joint (lower, upper) jerk limits [m/s³ or rad/s³], used when override_limits.

__hash__ class-attribute instance-attribute

Python
__hash__: None = None

createKey staticmethod

Python
createKey() -> int

The key every profile of this class carries in a ProfileDictionary.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

RuckigTrajectorySmoothing

Bases: TimeParameterization

__init__

Python
__init__(name: str = 'RuckigTrajectorySmoothing') -> None

ScalingsLengthError

Bases: ValueError

rescaleTimings got a scalings list that is not len(program) long.

rescaleTimings

Python
rescaleTimings(program: CompositeInstruction, scalings: Sequence[float]) -> None

Rescale the timing of each sub-composite of program in place.

Every element of program must be a CompositeInstruction; scalings[i] scales element i linearly (0.5 is half speed). A scaling below 1e-6 is replaced by 1.0 with only a logged warning.

Raises:

Type Description
ScalingsLengthError

scalings is not len(program) long (a ValueError).