RMW for ROS 2 using Zenoh as the middleware
翻譯準備中
開發工具C++ · CMakeGitHub @ros2自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗| Package | Status |
|---|---|
| rmw_zenoh_cpp | |
| zenoh_cpp_vendor | |
| zenoh_security_tools |
A ROS 2 RMW implementation based on Zenoh that is written using the zenoh-cpp bindings.
For information about the Design please visit design page.
[!NOTE] See available distro branches, eg.
jazzy, for supported ROS 2 distributions.
rmw_zenoh can either be installed via binaries (recommended for stable development) or built from source (recommended if latest features are needed). See instructions below.
Binary packages for supported ROS 2 distributions (see distro branches) are available on respective Tier-1 platforms for the distributions. First ensure that your system is set up to install ROS 2 binaries by following the instructions here.
Then install rmw_zenoh binaries using the command
sudo apt update && sudo apt install ros-<DISTRO>-rmw-zenoh-cpp # replace <DISTRO> with the codename for the distribution, eg., rolling
[!NOTE] By default, we vendor and compile
zenoh-cppwith a subset ofzenohfeatures. TheZENOHC_CARGO_FLAGSCMake argument may be overwritten with other features included if required. TheUSE_SYSTEM_ZENOHCMake argument can be used to use non-vendored system libraries instead. The user must ensure that the non-vendored libraries are found by CMake and provide the necessary features (e.g., shared-memory support). See zenoh_cpp_vendor/CMakeLists.txt for more details.
# replace <DISTRO> with ROS 2 distro of choice
mkdir ~/ws_rmw_zenoh/src -p && cd ~/ws_rmw_zenoh/src
git clone https://github.com/ros2/rmw_zenoh.git -b <DISTRO>
cd ~/ws_rmw_zenoh
rosdep install --from-paths src --ignore-src --rosdistro <DISTRO> -y
source /opt/ros/<DISTRO>/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Make sure to source the built workspace using the commands below prior to running any other commands.
cd ~/ws_rmw_zenoh
source install/setup.bash
pkill -9 -f ros && ros2 daemon stop
Without this step, ROS 2 CLI commands (e.g. ros2 node list) may
not work properly since they would query ROS graph information from the ROS 2 daemon that
may have been started with different a RMW.
[!NOTE] Manually launching Zenoh router won't be necessary in the future.
# terminal 1
ros2 run rmw_zenoh_cpp rmw_zenohd
[!NOTE] Without the Zenoh router, nodes will not be able to discover each other since multicast discovery is disabled by default in the node's session config. Instead, nodes will receive discovery information about other peers via the Zenoh router's gossip functionality. See more information on the session configs below.
talker# terminal 2
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp talker
listener# terminal 2
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp listener
The listener node should start receiving messages over the /chatter topic.
By default, Zenoh sessions created by rmw_zenoh will attempt to connect to a Zenoh router to receive discovery information.
To understand more about Zenoh routers and Zenoh sessions, see Zenoh documentation.
The ZENOH_ROUTER_CHECK_ATTEMPTS environment variable can be used to configure if and how a Zenoh session checks for the presence of a Zenoh router.
The behavior is explained in the table below.
| ZENOH_ROUTER_CHECK_ATTEMPTS | Session behavior |
|---|---|
| 0 | Indefinitely waits for connection to a Zenoh router. |
| < 0 | Skips Zenoh router check. |
| > 0 | Attempts to connect to a Zenoh router in ZENOH_ROUTER_CHECK_ATTEMPTS attempts with 1 second wait between checks. |
| unset | Equivalent to 1: the check is made only once. |
以上為 README 的開頭部分。其餘內容請閱讀原文。 檢視完整 README ↗