Middleware

ROS2 sends its messages through a middleware, the RMW implementation, selected with the environment variable RMW_IMPLEMENTATION. Nodes that use different implementations do not see each other, so every computer that takes part in an experiment must use the same one.

Use

Middleware

Notes

Real lab with muCars

Eclipse Zenoh (rmw_zenoh_cpp), required

The muCars use Zenoh and connect to the Zenoh router on the central workstation (tcp/192.168.1.249:7447). The central workstation, the desktop image and every computer that runs a motion planner for the real lab use Zenoh as well.

Simulation on your computer

CycloneDDS (rmw_cyclonedds_cpp) or Zenoh

CycloneDDS needs no router and is the default of the simulation image. Use it only for local simulations.

Not recommended

FastDDS (rmw_fastrtps_cpp), the ROS2 default

Does not support the transient local messages the CPM Lab relies on in Jazzy and Humble. The Control Center shows a warning.

The workspace’s Docker setup (make control-center, VS Code dev container) uses Zenoh with its own router container, see Developing in Docker.

Zenoh

Install Zenoh and select it in every terminal, e.g. in your ~/.bashrc:

sudo apt install ros-jazzy-rmw-zenoh-cpp
echo "export RMW_IMPLEMENTATION=rmw_zenoh_cpp" >> ~/.bashrc

Zenoh nodes find each other through a router. In the lab, the router runs on the central workstation. On your own computer, start it in a separate terminal before the other nodes:

ros2 run rmw_zenoh_cpp rmw_zenohd

By default, nodes connect to the router on the same computer (tcp/localhost:7447). A computer in the lab network without its own router, e.g. a laptop that runs your motion planner, connects to the router of the central workstation instead:

export ZENOH_CONFIG_OVERRIDE='connect/endpoints=["tcp/192.168.1.249:7447"]'

The muCars do the same with a session configuration file (ZENOH_SESSION_CONFIG_URI), see muCar.

Note

The router is not started automatically when the central workstation boots. If nodes on different computers do not see each other, check that it runs, see Troubleshooting Guide.

CycloneDDS

For simulations on your own computer, CycloneDDS works without a router:

sudo apt install ros-jazzy-rmw-cyclonedds-cpp
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

CycloneDDS cannot talk to the muCars. Switch to Zenoh before you connect to the real lab.