Robotics

PyZeROS: A pure Python, 5.5x faster ROS 2 client built on Zenoh

No ROS installation needed – just pip install and go, with asyncio and 13 µs latency.

Deep Dive

PyZeROS, created by developer 2lian, is an experimental ROS 2 client written entirely in pure Python. Unlike rclpy, which requires a full ROS installation and message compilation, PyZeROS communicates with ROS 2 through Zenoh (via rmw_zenoh_cpp) and installs via a standard pip install pyzeros. It's designed for asyncio, making it a natural fit for asynchronous Python and robotics. Custom ROS messages are defined as Python dataclasses with IDL support, eliminating the need for .msg files or CMake configuration. The library works with ROS 2 distributions Jazzy and Lyrical, and its minimal dependencies ensure compatibility with most Python environments (venv, uv, pipx, etc.).

Performance-wise, PyZeROS claims a 5.5× improvement over rclpy in round-trip latency benchmarks: ~13 µs vs. ~70 µs, measured locally with sensor_msgs/JointState messages. This speed gain comes from eliminating rclpy's callback-and-executor overhead and leveraging Python's asyncio for efficient async I/O. The library does not aim to support every ROS feature, prioritizing Python ecosystem tools like argparse, subprocess, and importlib.resources. It's ideal for teams that need lightweight Python-based ROS 2 interaction without the full ROS build toolchain.

Key Points
  • Pure Python ROS 2 client – pip install, no ROS installation, no colcon build required.
  • 5.5× faster than rclpy: ~13 µs vs ~70 µs round-trip latency in microbenchmarks.
  • Custom messages defined as Python dataclasses with automatic IDL serialization.

Why It Matters

PyZeROS dramatically lowers the barrier for Python developers to build performant ROS 2 apps without the heavy toolchain.

📬 Get the top 10 AI stories daily