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 both cases make use you run this command on your terminal

xhost +local:docker

Simulation Mode (Default)

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

python3 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, IT IS MANDATORY TO SET THE --target-ip ARGUMENT.

python3 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 needed
  • Uses local ROS 2 simulation environment

  • Robot Mode (with --with-zenoh):

  • Requires Zenoh bridge for robot communication
  • Connects to physical robot at specified IP
  • Used for actual robot operation measurements / commands

Key Differences

  • Simulation: Local ROS 2 nodes communicate directly
  • Robot: Uses Zenoh bridge for network communication
  • Simulation: No network configuration needed
  • Robot: 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 simualtion 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