Skip to content

Trajectory

A time-parameterized path for one robot: joint positions and velocities on a time base, produced by Scene.plan, Scene.plan_to_pose, and Scene.plan_motion.

traj = scene.plan_to_pose((0.35, -0.2, 0.35), seed=0)

traj.duration                      # seconds
traj.sample(0.5)                   # joint positions at t = 0.5 s
traj.export_csv("motion.csv", dt=0.008)
traj.export_script("prog.script", dialect="urscript")

Trajectory

A planned, time-parameterized joint trajectory.

duration property

duration

feed_report property

feed_report

Feed adherence of a toolpath bake (None for ordinary plans).

joint_names property

joint_names

positions property

positions

segment_ends property

segment_ends

Time at which each motion segment ends (empty for single plans).

segments property

segments

Sparse planned path per segment, as (kind, waypoints) tuples with kind in {"joint", "cartesian_line"}. For joint segments these are the shortcut waypoints, for cartesian segments the IK follow points; both endpoints are included. This is the input for script exporters (one move command per waypoint), unlike positions, which is densified for time parameterization.

times property

times

velocities property

velocities

export_csv method descriptor

export_csv(path, dt=None)

Writes a CSV with header t,<joint...>. With dt the trajectory is resampled uniformly; otherwise the internal waypoints are written.

export_json method descriptor

export_json(path)

Writes {joint_names, times, positions, velocities} as JSON.

export_script method descriptor

export_script(
    path,
    dialect="urscript",
    name=None,
    speed_scale=1.0,
    blend_radius=0.0,
    tcp_speed=0.25,
    tcp_accel=1.2,
    move_to_start=True,
)

Writes to_script output to path. The program name defaults to the file stem (e.g. pick.scriptdef pick():).

sample method descriptor

sample(t)

Joint positions at time t (cubic Hermite, clamped to the span).

to_script method descriptor

to_script(
    dialect="urscript",
    name="botrail_program",
    speed_scale=1.0,
    blend_radius=0.0,
    tcp_speed=0.25,
    tcp_accel=1.2,
    move_to_start=True,
)

Renders the planned motion as a vendor robot script and returns it as a string. The script replays the sparse planned waypoints as vendor move commands (segments); time parameterization is left to the robot controller. Speeds derive from the joint limits scaled by speed_scale; blend_radius (m) rounds intermediate waypoints (keep 0 unless verified on the controller — overlapping blends abort some controllers); linear-move speed is tcp_speed (m/s). With move_to_start the program begins with a joint move to the first waypoint. Currently supported dialects: "urscript".