state_space_response_viz¶
RViz playback of RobotTrajectory files. See the guide for the ROS interface table.
playback — the transport state machine¶
PlaybackClock: the transport state machine, independent of ROS and UI.
Answers exactly one question — “what simulation time is it?” — as a pure function of an injected wall-clock reading, so it is unit-testable with fake clocks and shared conceptually with the JS twin in the setup assistant. Every mutation (play, pause, seek, speed change) rebases the (wall_anchor, sim_anchor) pair, so a speed change never makes the cursor jump and dropped ticks never accumulate error.
renderers — TrajectoryRenderer interface¶
TrajectoryRenderer: put a sampled RobotFrame on a screen.
The playback engine operates on frames and delegates to whichever
renderers are active — how a frame becomes pixels (JointState + TF for
RViz, setJointValue for the web viewer, an encoder for video export) is an
implementation detail hidden behind render(frame). Renderers hold
transport handles created in setup; they are stateless between frames.
- class state_space_response_viz.renderers.TrajectoryRenderer[source]¶
Bases:
objectInterface:
setuponce before playback,renderper frame.- setup(traj: RobotTrajectory) None[source]¶
- render(frame: RobotFrame) None[source]¶
- class state_space_response_viz.renderers.RVizRenderer(node, *, joint_states_topic: str = 'joint_states', base_frame: str = 'base_link', world_frame: str = 'world')[source]¶
Bases:
TrajectoryRendererRenders frames into RViz by publishing sensor_msgs/JointState (and a world→base TF when the trajectory carries a base pose). Those transport details stay invisible above this class.
Mimic joints are intentionally absent from trajectories — robot_state_publisher derives them from the URDF.
- setup(traj: RobotTrajectory) None[source]¶
- render(frame: RobotFrame) None[source]¶
player_node — the response_player node¶
response_player: RobotTrajectory playback node.
Pure composition — PlaybackClock (what time is it?) × FrameSampler (what does the robot look like then?) × TrajectoryRenderer (put it on screen). The node itself only wires transport control to the clock:
ros2 run state_space_response_viz response_player –ros-args -p trajectory:=/path/to/trajectory.npz
ros2 service call /response_player/pause std_srvs/srv/Trigger ros2 param set /response_player speed 0.5 ros2 param set /response_player seek 1.25