Build the ROS 2 gateway

Crates that integrate with ROS 2 are tightly coupled to the ROS 2 workspace that they are built against as they link to the specific rcl library of the workspace at build time.

A crate built against one workspace is likely not to work with a different workspace.

Thus, it is recommended to build the ROS 2 integration crates from source for the specific ROS 2 workspace you are using.

Building the gateway

First clone the iceoryx2 source:

git clone git@github.com:eclipse-iceoryx/iceoryx2.git
cd iceoryx2

The gateway and its applications must be built from the same iceoryx2 version. Applications depending on the main branch need no further step. Otherwise, check out the release tag matching their iceoryx2 dependency:

git checkout vX.Y.Z

Then source your ROS 2 workspace and build the ROS 2 gateway:

source /opt/ros/<distro>/setup.bash   # e.g. jazzy, humble, etc.
                                      # or source /path/to/install/setup.bash

cargo build --manifest-path integrations/ros2/Cargo.toml --bin iox2-link-gateway-ros2

This builds the ROS 2 gateway CLI along with the crates it consists of.

Installing the gateway

To launch the gateway with iox2 link gateway ros2, install the iox2 CLI and the gateway from the same checkout, in the same sourced shell:

cargo install --path iceoryx2-cli
cargo install --path integrations/ros2/link-gateway-cli

Important

The installed gateway only works with the ROS 2 workspace that was sourced when building it and with applications using the same iceoryx2 version. Reinstall the gateway after switching either of them.

Then verify that the CLI discovers the gateway:

iox2 link gateway --list

Important

At runtime, the gateway loads the typesupport libraries of every message type it propagates. The distribution provides them for its own message packages. For custom message packages, source the workspace they are built in before running the gateway.

Further Reading

ROS 2 Integrations

Overview of the ROS 2 integrations and the containerized development environment they are developed in.

https://github.com/eclipse-iceoryx/iceoryx2/tree/main/integrations/ros2
ROS 2 Gateway Examples

Example applications propagated to ROS 2 by the gateway, one set per translator.

https://github.com/eclipse-iceoryx/iceoryx2/tree/main/integrations/ros2/examples
Links: Tunnels and Gateways

Understand how to extend iceoryx2 beyond its shared memory domain.

Links