|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |
Launch files
Messages
Services
Plugins
Recent questions tagged rxros2_cpp at Robotics Stack Exchange
|
rxros2_cpp package from rxros2 reporxros2_cpp rxros2_cpp_examples rxros2_py rxros2_py_examples |
ROS Distro
|
Package Summary
| Tags | No category tags. |
| Version | 0.1.0 |
| License | Apache-2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Description | Reactive programming for ROS 2 |
| Checkout URI | https://github.com/rosin-project/rxros2.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | reactive-programming rxcpp rxpy ros2 |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Henrik Larsen
- G.A. vd. Hoorn
- Andrzej Wasowski
Authors
- Henrik Larsen
RxROS2 - Reactive Programming for ROS2
Introduction
RxROS2 is new API for ROS2 based on the paradigm of reactive programming. Reactive programming is an alternative to callback-based programming for implementing concurrent message passing systems that emphasizes explicit data flow over control flow. It makes the message flow and transformations of messages easy to capture in one place. It eliminates problems with deadlocks and understanding how callbacks interact. It helps you to make your nodes functional, concise, and testable. RxROS2 aspires to the slogan ‘concurrency made easy’.
Contents
- RxROS2 - reactive Programming for ROS2
Acknowledgements
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.
Creating a RxROS2 Node
A RxROS2 node is fundamentally a ROS2 node. It can be created in two distinct ways: Either by means of creating a class that is a sub-class of a rxros2::Node or by using the function rxros2::create_node.
Creating a RxROS2 Node using a Class
The following code shows how a RxROS2 node is created using a class:
#include <rxros/rxros2.h>
struct MyNode: public rxros2::Node {
MyNode(): rxros2::Node("my_node") {}
void run() {
//... add your code here
}
};
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
auto my_node = std::make_shared<MyNode>();
my_node->start();
rclcpp::spin(my_node);
rclcpp::shutdown();
return 0;
}
Common for all RxROS2 programs is that they include the rxros/rxros2.h header file. It contains all the necessary code, including observables and operators, to get started using reactive programming (RxCpp) with ROS2.
MyNode is defined as struct rather than a class to take advantage of that all properties and member functions are public. MyNode is further defined as a rxros2::Node. The rxros2::Node is a very simple class. It is a sub-class of rclcpp::Node and therefore also a ROS2 node. The constructor of the rxros2::Node takes the name of the node as argument. In this case “my_node”. The rxros2::Node has a virtual method named run that must be implemented by the sub-class, i.e. MyNode in this case. rxros2::Node contains further a function start. It will execute the run function in a new thread.
The main function is straight forward: It first initialize rclcpp. Then it creates an instance of MyNode and executes the start function. The start function will execute the run function of MyNode in a new thread. It is possible to call run directly from the main function simply by executing my_node->run(). But be sure in this case that the run function is not blocking or else the rclcpp::spin function is not called. rclcpp::spin is needed in order to publish and listen to ROS2 topics. rclcpp::shutdown is finally called to terminate the node in case the rclcpp::spin function has been terminated.
Creating a RxROS2 Node using the create_node function
The other other way to create a RxROS2 node is by using the function call rxros2::create_node. This is done as follows:
```cpp #include <rxros/rxros2.h>
int main(int argc, char **argv) { rclcpp::init(argc, argv); auto my_node = rxros2::create_node(“my_node”);
File truncated at 100 lines see the full file
Package Dependencies
| Deps | Name |
|---|---|
| ament_cmake_ros | |
| ament_cmake | |
| rclcpp | |
| rclcpp_action |
System Dependencies
Dependant Packages
| Name | Deps |
|---|---|
| rxros2_cpp_examples |