curobo.util.trajectory module

class InterpolateType(value)

Bases: Enum

An enumeration.

LINEAR = 'linear'

linear interpolation using scipy

CUBIC = 'cubic'

cubic interpolation using scipy

QUINTIC = 'quintic'

quintic interpolation using scipy

LINEAR_CUDA = 'linear_cuda'

cuda accelerated linear interpolation using warp-lang custom kernel :meth: get_cuda_linear_interpolation

KUNZ_STILMAN_OPTIMAL = 'kunz_stilman_optimal'

Uses “Time-optimal trajectory generation for path following with bounded acceleration and velocity.” Robotics: Science and Systems VIII (2012): 1-8, Kunz & Stillman.

get_linear_traj(
positions,
dt=0.5,
duration=20,
tensor_args={'device': 'cpu', 'dtype': torch.float32},
max_traj_pts=None,
compute_dynamics=True,
)
get_smooth_trajectory(
raw_traj: Tensor,
degree: int = 5,
)
get_spline_interpolated_trajectory(
raw_traj: Tensor,
des_horizon: int,
degree: int = 5,
)
get_batch_interpolated_trajectory(
raw_traj: JointState,
raw_dt: Tensor,
interpolation_dt: float,
max_vel: Tensor | None = None,
max_acc: Tensor | None = None,
max_jerk: Tensor | None = None,
kind: InterpolateType = InterpolateType.LINEAR_CUDA,
out_traj_state: JointState | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
max_deviation: float = 0.1,
min_dt: float = 0.02,
max_dt: float = 0.15,
optimize_dt: bool = True,
)
get_cpu_linear_interpolation(
raw_traj,
traj_steps,
out_traj_state,
kind: InterpolateType,
opt_dt=None,
interpolation_dt=None,
)
get_cpu_kunz_stilman_interpolation(
raw_traj: JointState,
traj_steps: int,
out_traj_state: JointState,
max_velocity: Tensor,
max_acceleration: Tensor,
opt_dt: float,
interpolation_dt: float,
max_deviation: float = 0.1,
)
get_interpolated_trajectory(
trajectory: List[Tensor],
out_traj_state: JointState,
des_horizon: int | None = None,
interpolation_dt: float = 0.02,
max_velocity: Tensor | None = None,
max_acceleration: Tensor | None = None,
max_jerk: Tensor | None = None,
kind=InterpolateType.CUBIC,
max_deviation: float = 0.05,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) JointState
linear_smooth(
x: array,
y=None,
n=10,
kind=InterpolateType.CUBIC,
last_step=None,
opt_dt=None,
interpolation_dt=None,
)
calculate_dt_fixed(
vel: Tensor,
acc: Tensor,
jerk: Tensor,
max_vel: Tensor,
max_acc: Tensor,
max_jerk: Tensor,
raw_dt: Tensor,
min_dt: float,
max_dt: float,
epsilon: float = 0.0001,
)
calculate_dt(
vel: Tensor,
acc: Tensor,
jerk: Tensor,
max_vel: Tensor,
max_acc: Tensor,
max_jerk: Tensor,
raw_dt: float,
min_dt: float,
epsilon: float = 0.0001,
)
calculate_dt_no_clamp(
vel: Tensor,
acc: Tensor,
jerk: Tensor,
max_vel: Tensor,
max_acc: Tensor,
max_jerk: Tensor,
epsilon: float = 0.0001,
)
calculate_traj_steps(
opt_dt: Tensor,
interpolation_dt: float,
horizon: int,
) Tuple[Tensor, Tensor]
calculate_tsteps(
vel: Tensor,
acc: Tensor,
jerk: Tensor,
interpolation_dt: float,
max_vel: Tensor,
max_acc: Tensor,
max_jerk: Tensor,
raw_dt: Tensor,
min_dt: float,
max_dt: float,
horizon: int,
optimize_dt: bool = True,
)