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:
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:
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:
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:
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
-
Overview of the ROS 2 integrations and the containerized development environment they are developed in.
-
Example applications propagated to ROS 2 by the gateway, one set per translator.
-
Understand how to extend
iceoryx2beyond its shared memory domain.