8 from pathlib
import Path
14 path = Path(__file__).parent.parent /
"models" /
"example-robot-data" /
"python"
15 sys.path.append(str(path))
17 from panda3d_viewer
import ViewerClosedError
25 talos.loadViewerModel(group_name=
"talos", color=(1, 1, 1, 1))
33 traj = np.repeat(talos.q0.reshape((-1, 1)), cycle_time * update_rate, axis=1)
34 beta = np.linspace(0, 1, traj.shape[1])
35 traj[[2, 9, 10, 11, 22, 15, 16, 17, 30]] = (
36 0.39 + 0.685 * np.cos(beta),
50 filename =
"talos.mp4"
51 ctx = talos.viz.create_video_ctx(filename, fps=fps)
52 print(f
"[video will be recorded @ {filename}]")
54 from contextlib
import nullcontext
57 print(
"[no recording]")
61 talos.play(traj.T, 1.0 / update_rate)
62 traj = np.flip(traj, 1)
69 except ViewerClosedError: