Location: examples/record_replay_trajectory/
Record a manipulation trajectory through teleoperation (or gravity-comp hand-guiding) and replay it exactly — useful for dataset collection and validating robot configurations.
- 1× YAM arm (follower or standalone)
- 1× CANable USB-CAN adapter
- Optional: leader arm + teaching handle for teleoperation recording
Record phase:
Arm in gravity-comp mode ──► Guide by hand ──► Save joint trajectory
Replay phase:
Load trajectory ──► Command arm via PD control ──► Arm replays motion
python examples/record_replay_trajectory/record_replay_trajectory.py --channel can0 --gripper linear_4310| Key | Action |
|---|---|
r |
Start / stop recording |
p |
Play back recorded motion |
s |
Save trajectory to file |
l |
Load trajectory from file |
q |
Quit |
--channel can0 # CAN bus channel
--gripper linear_4310 # Gripper type (for gravity compensation)
--output file.npy # Output filename
--load file.npy # Load and replay a trajectory at startup- Run the script — arm enters gravity-comp mode
- Press
rto start recording, guide the arm by hand, pressrto stop - Press
pto replay the captured motion - Press
sto save, orlto load a previously saved trajectory
Trajectories are saved as NumPy arrays:
import numpy as np
# Shape: (T, 6) — T timesteps, 6 joints
trajectory = np.load("trajectory.npy")
print(trajectory.shape) # (500, 6)