Gripper Visualize Rerun
SUMMARY
Visualize Rerun draws the gripper in Rerun from its URDF. Static meshes are uploaded once; later calls only update link transforms.
UNITS
tcp_transform is a 4x4 homogeneous matrix (world_T_tool_base).
The Skill
python
gripper.visualize_rerun(tcp_transform=None, recording_stream=None)The Code

python
"""
Demonstrates how to visualize the meshes of a gripper kinematics model in
Rerun for the Synapse SDK.
Supports all.
Usage:
python visualize_rerun.py
python visualize_rerun.py --save-rrd visualize_rerun.rrd
"""
import argparse
import rerun as rr
from telekinesis.synapse.tools.parallel_grippers import onrobot
def init_rerun(app_id: str, save_rrd: str | None) -> "rr.RecordingStream":
"""Start a Rerun recording, live in the viewer or saved to an .rrd file."""
rr.init(app_id, spawn=save_rrd is None)
recording = rr.get_global_data_recording()
if save_rrd:
recording.save(save_rrd)
return recording
def main(save_rrd: str | None = None) -> None:
"""Visualizes an OnRobot gripper in Rerun while translating it along +X."""
#===================== Create Gripper ======================================
gripper = onrobot.OnRobotRG6()
# =================== Visualization (Optional) ==============================
# The first call uploads the static meshes; subsequent calls only update
# the transforms.
recording = init_rerun("telekinesis_synapse_visualize_rerun", save_rrd)
gripper.visualize_rerun(recording_stream=recording)
recording.flush()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Gripper visualization Synapse example")
parser.add_argument("--save-rrd", type=str, default=None,
help="Save the Rerun recording to this .rrd file instead of opening the viewer")
args = parser.parse_args()
main(save_rrd=args.save_rrd)Rerun output
The viewer shows an OnRobot RG6 parallel gripper in its default open configuration at the world origin. The static meshes are uploaded once, because the gripper does not move. Pass --save-rrd visualize_rerun.rrd to save the recording instead of opening the viewer, and open it later with rerun visualize_rerun.rrd.
Running the Example
bash
python visualize_rerun.pyTo save the Rerun recording to a file instead of opening the viewer:
bash
python visualize_rerun.py --save-rrd visualize_rerun.rrdFor all options:
bash
python visualize_rerun.py --helpParameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
tcp_transform | np.ndarray | None | None | 4x4 pose of the tool base in the world. Typically robot.get_link_transforms()[robot.active_tcp]. None places the tool at the origin. |
recording_stream | rr.RecordingStream | None | None | An existing Rerun recording to log into. None starts a new one and spawns a viewer. |
Returns
| Type | Description |
|---|---|
None | The gripper is logged to Rerun. If the tool has no model, nothing happens. |
How to Tune the Parameters
Pass the same recording_stream the robot uses so the gripper and arm share one viewer, and update tcp_transform each frame to follow the flange.
Where to Use the Skill
- Checking models - Confirm a gripper model before using it.
- Cell visualization - Show the gripper attached to a moving arm.
When Not to Use the Skill
- You need numbers, not a picture - use Get Link Transforms.