Skip to content

Visualization From Docker

This package provides a ROS 2 visualization that launches RViz2 and Zenoh bridge in Docker containers. It's designed to work with robot systems and provides visualization capabilities for robot state and sensor data.

Features

  • Launches RViz2 visualization tool in a Docker container
  • Optional Zenoh bridge support for robot communication
  • Supports character-specific configurations

Prerequisites

  • Docker installed on your system
  • X11 display server (for GUI visualization)

Usage

In most setups, no extra X11 permission command is needed. If RViz does not open and you see X11 permission errors, run:

xhost +local:docker

Simulation Mode (Default)

For simulation, simply run the visualization tool without the Zenoh bridge:

Run from the SDK root:

python3 visualization/visualization_from_docker/launch.py --character <character_name>

Robot Mode (With Zenoh Bridge)

For actual robot operation, use the Zenoh bridge to connect with the physical robot:

⚠️ IMPORTANT:

FOR ZENOH TO CONNECT TO THE ROBOT, SET --target-ip (OR target_ip IN common/configs/config.yaml) WHEN USING --with-zenoh.

python3 visualization/visualization_from_docker/launch.py --character <character_name> --with-zenoh --target-hostname <hostname>  --target-ip <robot_ip>

Usage Differences

  • Simulation mode (default): No Zenoh bridge, uses the local ROS 2 simulation environment.
  • Robot mode (--with-zenoh): Requires Zenoh bridge, connects to the physical robot at the specified IP, used for real robot operation.

Key Differences

  • Simulation: Local ROS 2 nodes communicate directly. No network configuration needed.
  • Robot: Uses Zenoh bridge for network communication. Requires proper network setup and robot IP.

Command Line Arguments

usage: visualization_from_docker/launch.py [-h] [--character CHARACTER]
                        [--target-hostname TARGET_HOSTNAME]
                        [--target-ip TARGET_IP] [--with-zenoh] [--debug]

Launch Zenoh bridge and RViz2 in separate Docker containers.

required for robot argument:
  --target-ip TARGET_IP
                        required IP address to use for Zenoh endpoints when working with real robot.
                        Defaults to --target-hostname.
optional arguments:
  -h, --help            show this help message and exit
  --character CHARACTER
                        Name of the character to launch. (default: miroki)
  --target-hostname TARGET_HOSTNAME
                        IP address or hostname to use for Zenoh endpoints
                        (default: localhost)
  --with-zenoh          Launch with Zenoh bridge (default: False). Set this
                        when working with robot.
  --debug               Enable debug logging.

How It Works

  1. The tool launches two Docker containers:
  2. zenoh_bridge: Handles communication between ROS 2 nodes and the robot
  3. rviz_container: Runs RViz2 visualization tool

  4. The RViz2 container:

  5. Loads character-specific URDF files for visualization
  6. Launches robot_state_publisher for robot state visualization

Troubleshooting

  • Ensure simulation or robot has started before launching the visualization
  • Verify X11 forwarding is properly configured
  • Check Docker container logs if visualization doesn't appear
  • Use --debug flag for detailed logging information