A Python bridge for ROS2 sensor data republishing with Zenoh communication
Project description
dexcontrol-rosbridge
A Python bridge for republishing sensor data between Zenoh and ROS2 networks when using Dexmate Robots.
Installation
Prerequisites
- Ubuntu 22.04 or 24.04
- Python 3.10+
- ROS2 (Humble or Jazzy)
- dexcontrol library installed and configured
Deployment Flexibility:
This package can run on either:
- Local development machine (recommended for development and testing)
- Jetson onboard computer
As long as dexcontrol can connect to the robot and Zenoh network, you can run this ROS bridge and other ROS applications on your local dev machine instead of the robot's Jetson.
Note:
We recommend using robostack and micromamba for the ROS2 and Python environments instead of the system-level ROS2 (at /opt/ros). Please follow the instructions here to create a micromamba environment with ROS2 inside.
If you have ROS2 installed on your system (i.e., at /opt/ros/{ROS_DISTRO}), please DO NOT source it before activating the micromamba environment to avoid environment conflicts. The keys to successful communication between your system ROS2 and the mamba ROS2 are:
- Make sure to use the same ROS2 distribution. (e.g., communication between Jazzy and Humble is problematic)
- Make sure to use the same RMW_IMPLEMENTATION (by default it's the same)
Install from source
# Activate your micromamba environment with ROS2 installed first
# micromamba activate ros_env
pip install dexcontrol_rosbridge
# Or install from source code below
# git clone https://github.com/dexmate-ai/dexcontrol-rosbridge.git
# pip install -e ./dexcontrol-rosbridge/
Usage
Re-publish sensor streams from Zenoh topics
First, make sure you set the correct robot name. This is the prefix for Zenoh topics. You can access the robot name on your robot's onboard computer by running echo $ROBOT_NAME. Also ensure that the corresponding sensors (e.g., head_camera or lidar) have been started using dexsensor launch --sensor.
export ROBOT_NAME=[...]
The repository provides a unified script that handles sensor types through command-line arguments:
# Publish head cameras and IMU
python scripts/republish_sensors.py --sensors head
# Publish LIDAR only
python scripts/republish_sensors.py --sensors lidar
# Publish LIDAR and chassis IMU together
python scripts/republish_sensors.py --sensors lidar chassis_imu
Available sensor groups (defaults from configs/sensor_mapping.yaml):
head_left- Head left camera (RGB)head_right- Head right camera (RGB)head_depth- Head depth camerahead_imu- Head IMU sensorlidar- Base LIDAR sensor (PointCloud2)chassis_imu- Chassis IMU sensorwrist- Wrist cameras (left/right RGB), publishes both streams togetherall- Enable every configured group
Wheel odometry
Run:
python scripts/publish_wheel_odometry.py
This will publish the wheel odometry using the differential vehicle model on Vega. The published topics are:
/odom # the wheel odometry
/left_wheel_velocity
/right_wheel_velocity
Configuration
Sensor groups are defined in src/dexcontrol_rosbridge/configs/sensor_mapping.yaml. Each top-level key
matches a CLI group:
head_left:
description: "Head left camera (RGB)"
type: camera
sensors:
- name: head_left_rgb
zenoh_topic: "camera/head/left_rgb"
ros2_topic: "/head_camera/left/image"
frame_id: "head_camera_left_link"
compressed: true
compression_format: "jpeg"
queue_size: 2
Add additional groups or streams by extending this file and passing --config <path> if you want to use
a custom mapping outside the packaged defaults.
Architecture
Multi-Process Design
Each sensor stream runs in a dedicated process:
Main Process
├── Camera Process 1 (+ Zenoh Session + ROS2 Node)
├── Camera Process 2 (+ Zenoh Session + ROS2 Node)
├── IMU Process (+ Zenoh Session + ROS2 Node)
└── LIDAR Process (+ Zenoh Session + ROS2 Node)
This is primarily for GIL isolation.
Data Flow
Zenoh Network → Zenoh Handler → Bounded Queue → Consumer Thread → Converter → ROS2 Publisher
- Zenoh Handler: Fast callback that enqueues samples (<0.1ms) without blocking
- Bounded Queue: Small FIFO queue (size: 1-3) for maintaining temporal ordering
- Consumer Thread: Single thread that processes samples sequentially (preserves order)
- Converter: Decodes and converts data to ROS2 message format
- ROS2 Publisher: Publishes to ROS2 topics with proper timestamps and frame IDs
Congestion Handling:
- When processing can't keep up with incoming rate, oldest frames are dropped
- Drop statistics are logged
License
GNU Affero General Public License v3.0 (AGPL-3.0)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dexcontrol_rosbridge-0.4.0-py3-none-any.whl.
File metadata
- Download URL: dexcontrol_rosbridge-0.4.0-py3-none-any.whl
- Upload date:
- Size: 74.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66de3f45e9dc1759f01b0ac9a2bb88386f93102baac91b65e0b174bbf0f881b8
|
|
| MD5 |
e29e73eb6870b460b8085c076429a56a
|
|
| BLAKE2b-256 |
8341fe012cc97fa76149a24c0acecd2dc79424d155ab77ed7ee88c20abbc6022
|
Provenance
The following attestation bundles were made for dexcontrol_rosbridge-0.4.0-py3-none-any.whl:
Publisher:
pypi.yml on dexmate-ai/dexcontrol-rosbridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dexcontrol_rosbridge-0.4.0-py3-none-any.whl -
Subject digest:
66de3f45e9dc1759f01b0ac9a2bb88386f93102baac91b65e0b174bbf0f881b8 - Sigstore transparency entry: 1276576637
- Sigstore integration time:
-
Permalink:
dexmate-ai/dexcontrol-rosbridge@a221763a4071c5d95a5e201b331e5b908b15a4b9 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/dexmate-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a221763a4071c5d95a5e201b331e5b908b15a4b9 -
Trigger Event:
push
-
Statement type: