Reactive Programming of Robots with RxROS

More Info
expand_more

Abstract

Reactive programming is an alternative to callback-based programming. This tutorial chapter first discusses the problems of asynchronous programming with callbacks and locks—the standard ROS 2 API—and then presents a way to overcome them using the reactive programming paradigm. We introduce RxROS: a new API for implementing ROS nodes, based on the paradigm of reactive programming. We demonstrate advantages on small code examples in a tutorial style using simple nodes written in RxROS for ROS 2, and show the results of performance experiments indicating that RxROS does not introduce any significant performance overhead. RxROS is available under a BSD license, with bindings for both ROS 1 and ROS 2, in both Python and C + +. The implementation of RxROS for ROS 2 is available at https://github.com/rosin-project/rxros2.