Skip to content

Native Visualization

This script provides a native ROS 2 visualization solution that launches RViz2 and, optionally, the Zenoh bridge directly on your host system. It's designed for use with robot systems, allowing visualization of robot state and sensor data both in simulation and on real hardware.


Prerequisites

Ensure you have the following installed on your system:

  • ROS 2 Humble
  • Zenoh Bridge for ROS 2 DDS
  • Python 3

Installation & Setup

i. Install ROS 2 Humble

Follow the official ROS 2 Humble installation guide.


ii. Install Zenoh Standalone Executable

a. Add the Zenoh APT repository:

echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list > /dev/null

b. Update package lists:

sudo apt update

c. Install Zenoh Bridge (ensure the version matches the robot):

sudo apt install zenoh-bridge-ros2dds=1.2.1

Quick Start

⚠️ IMPORTANT:

BEFORE LAUNCHING THE VISUALIZATION, ENSURE THAT EITHER THE ROBOT IS POWERED ON AND RUNNING, OR THE SIMULATION IS ALREADY STARTED.

The visualization will not display meaningful data unless the robot or simulation is actively publishing state and sensor information.

Simulation Mode (Default)

a. Navigate to the description package:

cd common/mirokai_description/

b. Source ROS 2:

source /opt/ros/humble/setup.bash

c. Build the workspace:

colcon build

d. Source the workspace:

source install/setup.bash

e. Navigate to the visualization project:

cd ../../visualization

f. Launch the visualization:

python3 native_visualization/launch.py --character <character_name>

Robot Mode (With Zenoh Bridge)

To visualize data from a physical robot using the Zenoh bridge : make sure to complete steps a–e above, then run:

⚠️ IMPORTANT:

FOR ZENOH TO CONNECT TO THE ROBOT, IT IS MANDATORY TO SET THE --target-ip ARGUMENT.

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

Command-Line Arguments

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

Launch Zenoh bridge and RViz2 natively on your machine.

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
                            Hostname or IP address for Zenoh endpoints (default: localhost).
  --with-zenoh              Launch with Zenoh bridge (default: False). Set this when working with a robot.
  --debug                   Enable debug logging.

Notes

  • Character Name: Replace <character_name> with the name of your robot character. The default is miroki.
  • Zenoh Version: Ensure the Zenoh bridge version matches what is running on the robot for compatibility.
  • Troubleshooting: Use the --debug flag for detailed logs if you encounter any issues.