ros2-viser

ROS 2 3D visualization library built on Viser. Launch it from fa-py-libraries, not as a standalone product entry and not from lerobot_ros2.

Repository: fiveages-sim/ros2-viser

README: README.md

Purpose

  • Subscribe robot URDF from /robot_description

  • Show joint state in a Viser 3D view

  • Optional FSM and gripper panels

  • All ROS 2 I/O goes through ros2_robot_interface (the visualizer creates an internal ROS2RobotInterface)

Primary launch (fa-py-libraries)

This is the supported operator path:

git clone https://github.com/fiveages-sim/fa-py-libraries.git
cd fa-py-libraries
./init.sh all          # Python 3.12 env; installs ros2-viser among other submodules
./run.sh viser

./run.sh with no arguments opens a menu; item 1 is ros2-viser launch. See fa-py-libraries.

lerobot_ros2 / robot_action_composer may list a PyPI extra viser>=0.2 for grasp-generation UI. That is a library dependency, not the ros2-viser launcher.

Library install (package development)

When you are working on the ros2_viser tree itself (from the README):

cd ros2_viser
pip install -e .

Requires ros2-robot-interface. The stack entry is the deploy workspace / fa-py-libraries, not pip install ros2-viser from an arbitrary venv.

Embedding (README API)

Class names below match the package README (ROS2ViserVisualizer / ROS2ViserConfig). There is no ViserVisualizer class in this repo.

from ros2_viser import ROS2ViserVisualizer, ROS2ViserConfig
import time

config = ROS2ViserConfig(
    robot_description_topic="/robot_description",
    joint_states_topic="/joint_states",
    root_node_name="/robot",
    update_rate=30.0,
)
visualizer = ROS2ViserVisualizer(config)
visualizer.start()
try:
    while True:
        time.sleep(1)
except KeyboardInterrupt:
    visualizer.stop()

Config fields documented in the README: robot_description_topic, joint_states_topic, root_node_name, update_rate, auto_connect, enable_fsm_panel, enable_gripper_panel.

Needs /robot_description and /joint_states publishing. Joint names must match the URDF.