• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

rmw implementation for iceoryx

Integration build and tests Linting Iceoryx build and tests

Installation

The following instructions show you how to install the iceoryx rmw implementation. The installation of rmw_iceoryx is pretty straight forward as iceoryx is available in ros2.repos. All provided packages can be built with colcon so that you can easily build rmw_iceoryx within your ROS 2 workspace. rmw_iceoryx is using the rosidl_typesupport_introspection which allows for building iceoryx on top of an existing ROS 2 workspace or even debian installation as no ROS 2 messages have to be built again.

To install rmw_iceoryx in a ROS 2 workspace with the latest ROS version, just execute the steps below:

mkdir -p ~/iceoryx_ws/src
cd $_
# LATEST_ROS_VERSION could be e.g. humble
git clone --branch LATEST_ROS_VERSION https://github.com/ros2/rmw_iceoryx.git

For alternative installation instructions and more details about iceoryx's internals, please see iceoryx's GitHub repo.

rmw_iceoryx is compatible with ROS 2 starting with Eloquent release. Assuming you have ROS 2 installed correctly, you can compile the iceoryx workspace with colcon:

cd ~/iceoryx_ws/
source /opt/ros/LATEST_ROS_VERSION/setup.bash  # alternatively source your own ROS 2 workspace
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro LATEST_ROS_VERSION -y
colcon build
# or with more options
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF

That's it! You've installed iceoryx and are ready to rumble.

Working with rmw_iceoryx_cpp

Getting Started

iceoryx is based on shared memory and features a shared memory management application called RouDi. RouDi is a daemon taking care of allocating enough space within the shared memory each node and is responsible for transporting messages between these nodes.

Before starting any iceoryx application, we therefore have to start the daemon.

./iceoryx_ws/install/iceoryx_posh/bin/iox-roudi  # /iceoryx_ws/install/bin/iox-roudi if you installed with as a merged workspace

You can then use rmw_iceoryx_cpp just like any other available rmw implementation. In order to specify the rmw implementation, you have to set the environment variable RMW_IMPLEMENTATION to rmw_iceoryx_cpp.

To run the ROS 2 c++ demo nodes with iceoryx, you can thus execute the following command:

source ~/iceoryx_ws/install/setup.bash
RMW_IMPLEMENTATION=rmw_iceoryx_cpp ros2 run demo_nodes_cpp talker

In another terminal, you can then subscribe to the talker as always:

source ~/iceoryx_ws/install/setup.bash
RMW_IMPLEMENTATION=rmw_iceoryx_cpp ros2 run demo_nodes_cpp listener

Zero Copy - The True Power

To exploit iceoryx's full potential, we want to leverage the zero copy transport mechanism it provides. For this to work, we have to take one step back and look at the details of what it means to enable zero copy data transport.

The basic zero copy workflow works as depicted in the picture below:

Step 1 loan_message()) A publisher asks rmw_iceoryx_cpp to loan a message from it. rmw_iceoryx_cpp allocates the appropriate message in its shared memory and loans it to the publisher.

Step 2 publish()) The publisher can fill in the data into the loaned message. When calling publish, the loaned message will be returned to the middleware and the publisher has no longer ownership over the message.

Step 3 take_loaned_message()) A subscription wants to take a message from the middleware. rmw_iceoryx_cpp gives a loaned message to the subscription which can execute their respective callbacks.

Step 4 return_loaned_message()) A subscription callback is finished and the loaned message is getting returned to the middleware.

Starting from ROS 2 Eloquent, these features are implemented within rclcpp. An application using these new features is shown in the code snippet below. For a fully working implementation, please have a look at this demo node.

auto non_pod_pub_ = node->create_publisher<std_msgs::msg::String>("/chatter", 1);
// Ask the publisher to loan a String message
auto non_pod_loaned_msg = non_pod_pub_->borrow_loaned_message();
non_pod_loaned_msg.get().data = "Hello World";
// Return ownership of that string message
non_pod_pub_->publish(std::move(non_pod_loaned_msg));

The code above has one problem though: How can the middleware allocate enough memory for the string message? The middleware can't possibly know the size of the string the user wants to put into that message.

That being said, in order to enable a true zero copy data transport we have to limit ourselves to fixed size data structures. The picture below tries to illustrate the difference between a fixed size message and a dynamically resizable message.

The plain old datatype (POD) on the left side is very well suited for zero copy data transport as its size is definitely defined (on compile time). The message definition shown on the right size is not made for zero copy transport as its size might vary during runtime and rmw_iceoryx_cpp can't determine how much memory should be allocated in the shared memory.

Thus, in order to make our demo work with zero copy, we can alternatively send a float64, as its size is clearly defined.

auto pod_pub_ = node->create_publisher<std_msgs::msg::Float64>("/float", 1);
// Ask the publisher to loan a Float64 message
auto pod_loaned_msg = pod_pub_->borrow_loaned_message();
pod_loaned_msg.get().data = 123.456f;
// Return ownership of that Float64 message
pod_pub_->publish(std::move(pod_loaned_msg));

If you'd like to play around with the zero copy transport, we recommend to checkout the fixed size image transport demo, which illustrates how iceoryx can be used to publish and subscribe up to even 4K images without having to copy them.

Limitations

rmw_iceoryx_cpp is currently under heavy development. Unfortunately, not all features are yet fully fleshed out.

ROS 2 command/feature Status
ros2 topic list ✔️
ros2 topic echo ✔️
ros2 topic type ✔️
ros2 topic info ✔️
ros2 topic hz ✔️
ros2 topic bw ✔️
ros2 node list ✔️
ros2 node info ✔️
ros2 interface * ✔️
ros2 service * ✔️
ros2 param list
rqt_graph ✔️
rqt_top ✔️
rqt_console ✔️
rqt_plot ✔️
rviz2 ✔️
ros2 bag
urdf
tf2
RMW Pub/Sub Events

More Repositories

1

ros2

The Robot Operating System, is a meta operating system for robots.
3,426
star
2

examples

Example packages for ROS 2
C++
683
star
3

ros2_documentation

ROS 2 docs repository
Python
541
star
4

rclcpp

rclcpp (ROS Client Library for C++)
C++
536
star
5

demos

C++
491
star
6

ros1_bridge

ROS 2 package that provides bidirectional communication between ROS 1 and ROS 2
C++
435
star
7

rclpy

rclpy (ROS Client Library for Python)
Python
288
star
8

rviz

ROS 3D Robot Visualizer
C++
287
star
9

rosbag2

C++
272
star
10

design

Design documentation for ROS 2.0 effort
JavaScript
224
star
11

common_interfaces

A set of packages which contain common interface files (.msg and .srv).
C++
220
star
12

ros2cli

ROS 2 command line interface tools
Python
173
star
13

rmw_zenoh

RMW for ROS 2 using Zenoh as the middleware
C++
171
star
14

rmw_fastrtps

Implementation of the ROS Middleware (rmw) Interface using eProsima's Fast RTPS.
C++
155
star
15

ros2_tracing

Tracing tools for ROS 2.
Python
137
star
16

rcl

Library to support implementation of language specific ROS Client Libraries.
C++
128
star
17

launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Python
123
star
18

geometry2

A set of ROS packages for keeping track of coordinate transforms.
C++
120
star
19

rclc

ROS Client Library for the C language.
C
113
star
20

rmw_cyclonedds

ROS 2 RMW layer for Eclipse Cyclone DDS
C++
112
star
21

turtlebot2_demo

C++
95
star
22

rmw

The ROS Middleware (rmw) Interface.
C
95
star
23

sros2

tools to generate and distribute keys for SROS 2
Python
89
star
24

freertps

a free, portable, minimalist, work-in-progress RTPS implementation
C
89
star
25

rosidl

Packages which provide the ROS IDL (.msg) definition and code generation.
C++
74
star
26

ros2_embedded_nuttx

This repository isn't actively being worked on. If you would like to take over maintainership please open a ticket on https://github.com/ros2/ros2
C
72
star
27

message_filters

C++
70
star
28

realtime_support

Minimal real-time testing utility for measuring jitter and latency.
C++
61
star
29

rcutils

Common C functions and data structures used in ROS 2
C
56
star
30

launch_ros

Tools for launching ROS nodes and for writing tests involving ROS nodes.
Python
55
star
31

domain_bridge

Bridge communication across different ROS 2 domains.
C++
52
star
32

ci

ROS 2 CI Infrastructure
Python
48
star
33

rmw_connextdds

ROS 2 RMW layer for RTI Connext DDS Professional and RTI Connext DDS Micro.
C++
47
star
34

example_interfaces

Msg, Srv, etc. ROS interfaces used in examples
CMake
47
star
35

system_tests

C++
38
star
36

rcl_interfaces

A repository for messages and services used by the ROS client libraries
C++
38
star
37

rcpputils

C++
31
star
38

tutorials

C++
30
star
39

ros2_embedded_freertos

This repository isn't actively being worked on. If you would like to take over maintainership please open a ticket on https://github.com/ros2/ros2 -- ROS 2 for embedded devices.
C
29
star
40

rmw_connext

Implementation of the ROS Middleware (rmw) Interface using RTI's Connext DDS.
C++
26
star
41

choco-packages

Chocolatey package configurations for upstream dependencies
PowerShell
25
star
42

rosbag2_bag_v2

rosbag2 plugin for replaying ros1 version2 bag files
C++
24
star
43

rmw_dps

Implementation of the ROS Middleware (rmw) Interface using Intel's Distributed Publish & Subscribe.
C++
23
star
44

buildfarm_perf_tests

Performance tests which run regularly on the buildfarm
C++
23
star
45

rmw_implementation

CMake infrastructure and dependencies for rmw implementations
C++
21
star
46

openrobotics_darknet_ros

ROS 2 interface to darknet, an open source neural network library.
C++
20
star
47

rosidl_python

rosidl support for Python
EmberScript
19
star
48

ros_core_documentation

Documentation for the Core ROS 2 packages which does not fit into one of the individual packages' documentation.
Python
17
star
49

ros_network_viz

Python
17
star
50

rcl_logging

Logging implementations for ROS 2.
C++
16
star
51

rmw_gurumdds

Implementation of the ROS middleware interface using GurumNetworks GurumDDS.
C++
13
star
52

ros_testing

Single point of entry for writing tests which involve Nodes in ROS 2.
Python
13
star
53

rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
C++
13
star
54

eigen3_cmake_module

Adds a custom find module for Eigen3
CMake
12
star
55

rmw_dds_common

C++
11
star
56

rmw_opensplice

Implementation of the ROS Middleware (rmw) interface using PrismTech's OpenSplice DDS.
C++
11
star
57

variants

Variants for ROS 2 (implemented as ament packages)
CMake
9
star
58

cookbook

A set of recipes for doing common tasks in ROS 2
C++
9
star
59

ros_workspace

Package to set ROS environment and configuration variables for ROS 2.
CMake
7
star
60

performance_test_fixture

Test fixture and CMake macro for using osrf_testing_tools_cpp with Google Benchmark
C++
7
star
61

tsc_working_group_governance_template

7
star
62

unique_identifier_msgs

CMake
6
star
63

rosidl_dds

Python
6
star
64

tlsf

Snapshot of TLSF allocator
C
6
star
65

detection_visualizer

ROS 2 package with a node that draws bound boxes for debugging computer vision nodes.
Python
6
star
66

rosidl_runtime_py

Runtime utilities for working with generated ROS interfaces in Python
Python
5
star
67

ros2_dds_profiles_examples

Example dds profiles to configure DDS correctly for different use cases
Python
5
star
68

rosidl_typesupport_gurumdds

Typesupport package which generates interfaces used by rmw_gurumdds.
EmberScript
4
star
69

python_cmake_module

CMake module for finding Python in a consistent way for all ROS 2 packages.
CMake
4
star
70

ament_cmake_ros

Python
4
star
71

darknet_vendor

CMake wrapper around darknet, an open source neural network framework.
CMake
4
star
72

ros2_generate_interface_docs

Python
4
star
73

middleware_working_group

Working group focused on functionality provided by the communication middleware and the language specific client libraries.
4
star
74

test_interface_files

CMake
3
star
75

rosidl_typesupport_opensplice

rosidl typesupport for PrismTech's OpenSplice DDS.
EmberScript
3
star
76

pybind11_vendor

Vendor package for pybind11.
CMake
3
star
77

tinyxml_vendor

Vendor package for providing tinyxml within a cmake package
CMake
2
star
78

rosidl_typesupport_fastrtps

rosidl typesupport for eProsima's FastRTPS
EmberScript
2
star
79

spdlog_vendor

Vendor package for spdlog
CMake
2
star
80

rosidl_dynamic_typesupport

Unified Interface for Dynamic (Runtime) Typesupport and Serialization
C
2
star
81

tinyxml2_vendor

temporary vendor package for tinyxml2
CMake
2
star
82

libyaml_vendor

CMake wrapper downloading and building libyaml
C++
2
star
83

orocos_kdl_vendor

CMake
2
star
84

unique_identifier

ROS 2 support for Universally Unique Identifiers
C++
1
star
85

rmw_freertps

rmw implementation using freertps
C++
1
star
86

netperf

C++
1
star
87

ros2.github.io

website for ros2.org
HTML
1
star
88

mimick_vendor

CMake
1
star
89

yaml_cpp_vendor

Vendor package for providing yaml cpp within a cmake package
CMake
1
star
90

ros2doc

i can haz docs?
Python
1
star
91

ros2cli_common_extensions

CMake
1
star
92

poco_vendor

CMake shim over the poco library: https://github.com/pocoproject/poco
CMake
1
star
93

rosidl_typesupport_connext

rosidl typesupport for RTI's Connext DDS.
EmberScript
1
star
94

docs.ros2.org

HTML
1
star