Pico-ROS is a lightweight ROS (Robot Operating System) client implementation designed for resource-constrained devices. Built on top of zenoh-pico and working in conjunction with rmw-zenoh, it provides an easy-to-use interface to ROS host from embedded systems.
-
picoros
- A lightweight ROS client implementation providing core abstractions:
- Node
- Publisher
- Subscriber
- Service server
- A lightweight ROS client implementation providing core abstractions:
-
picoserdes
- CDR serialization/deserialization for ROS messages
- Custom type generation from header files.
-
picoparams
- Parameter server implementation built using picoros and picoserdes
- Customizable parameter backend interface
- Compatible with ROS 2 parameter services
- C compiler and CMake build system
- zenoh-pico
- Micro-CDR
- rmw-zenoh (for ROS 2 integration)
git clone <repo>
cd <repo_path>
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make- Custom type definitions:
-DUSER_TYPE_FILE=user_types.h - Disable examples:
-DPICOROS_BUILD_EXAMPLES=OFF - Disable tests:
-DPICOROS_BUILD_TESTS=OFF
The project includes several example applications demonstrating different features:
talker.c&talker.cpp: Basic publisher examplelistener.c: Basic subscriber examplesrv_add2ints.c: Service server exampleparams_server.c: Parameter server implementationodometry_publisher.c&odometry_listener.c: ROS odometry message handlingbatteryState_publisher.cBatteryState message with sequence fields.jointState_publisher.cppJointState message with sequence fields in cpp.
-
Ensure ROS 2 is running with
rmw_zenoh(Installation Guide) -
In separate terminals, run the example nodes:
# Terminal 1: Run publisher ./talker -m client -a <zenoh-router-address> # Terminal 2: Run subscriber ./listener -m client -a <zenoh-router-address> # Terminal 3: Run service server ./srv_add2ints -m client -a <zenoh-router-address> # Terminal 4: Run parameter server ./param_server -m client -a <zenoh-router-address>
-
Interact with nodes from ROS 2:
# Subscribe to messages ros2 topic echo /picoros/chatter # Call service ros2 service call /picoros/add2 example_interfaces/srv/AddTwoInts '{a: 1, b: 2}' # List parameters ros2 param list /picoros
The project uses Doxygen for documentation. To generate and read:
# Install dependencies:
sudo apt-get install doxygen graphviz
# Generate documentation:
cd docs
./generate.sh
# View documentation:
# Open in your default browser
xdg-open docs/generated/html/index.htmlPico-ROS is ideal for resource-constrained microcontroller-based ROS nodes and edge devices in ROS networks.
While it provides core ROS functionality, it's not intended to replace full ROS implementations like rclc or rclcpp for systems with more resources.
See the examples directory for implementation references.
Automatic generation of user_types.h file can be done using scripts in /tools/type-gen. Format of the file is descibed in picoserdes.h. Example with standard ROS types can be found in example_types.h.
For compatibility with rmw_zenohd default configuration, set matching zenoh-pico lease duration settings with defines or edit the zenoh-pico config.h file:
-DZ_TRANSPORT_LEASE=60000and-DZ_TRANSPORT_LEASE_EXPIRE_FACTOR=2
Examples of projects using Pico-ROS can be found in picoros-examples.
See LICENSE file for details.
