Reactive programming for ROS 2.
This repository contains the ROS 2 version of rxros.
As the implementation of this new version is rather different from the ROS 1 version, the packages are hosted in a separate repository instead of as a branch in rosin-project/rxros
.
For more information on the design and use of rxros2
, please see the README.md
files in the rxros2_cpp
and the rxros2_py
package directories.
Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components. More information: rosin-project.eu
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 732287.
The RxROS2 library depends on and uses the following software:
- Ubuntu Focal Fossa 20.04 and ROS2 Foxy Fitzroy
- Reactive C++ (RxCpp) v4.0
- Reactive Python (RxPy) v3.1.0
Please follow the installation instruction of Ubuntu at https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview
and the installation instructions of ROS2 at https://index.ros.org/doc/ros2/Installation/.
Reactive C++ (RxCpp) and reactive Python (RxPy) will be installed as part of installing RxROS2 (see instructions below). They do not have to be installed separately.
The current installation instructions are manual, but will soon be replaced by proper packages that will allow easy installation of RxROS2.
Installation of rosdep
(this will resolve our dependencies):
sudo apt install python3-rosdep
sudo rosdep init
Installation of colcon
(build tool):
sudo apt install python3-colcon-common-extensions
Build of RxROS2 for Python and C++:
# create a workspace
# if you already have a workspace, skip this step
mkdir -p $HOME/rxros2_ws/src
cd $HOME/rxros2_ws
# download the repository
git clone https://github.com/rosin-project/rxros2.git src/rxros2
# make sure all dependencies are installed
rosdep update && sudo apt update
rosdep install --from-paths $HOME/rxros2_ws --ignore-src --rosdistro=foxy
# check the output of 'rosdep install ..' and make sure there were no errors
# build the workspace
colcon build
If this was successful, do not forget to activate the workspace by executing source $HOME/rxros2_ws/install/setup.bash
(if using Bash as the shell).
After having built RxROS2, you may try to start any of the following RxROS2 nodes:
# RxROS2+RxCpp based nodes
ros2 run rxros2_cpp_examples talker_new_style
ros2 run rxros2_cpp_examples talker_old_style
# RxROS2+RxPy based nodes
ros2 run rxros2_py_examples talker_new_style
ros2 run rxros2_py_examples talker_old_style
The talker nodes can be combined with any of the listener nodes:
# RxROS2+RxCpp based nodes
ros2 run rxros2_cpp_examples listener_new_style
ros2 run rxros2_cpp_examples listener_old_style
# RxROS2+RxPy based nodes
ros2 run rxros2_py_examples listener_new_style
ros2 run rxros2_py_examples listener_old_style
any combination of talker
and listener
should work.
We will describe the steps to create a ROS 2 package based on RxROS2 at a later time.
In essence these packages are regular ROS 2 packages, they simply depend on rxros2_cpp
or rxros2_py
.