Reactive ROS

Hi,

Just out of curiosity, did someone experiment with ROS and the reactive programming paradigm ?

It seems to me this could be a good paradigm to introduce in ROS to give a more theoretically sound basis for it s distribution mechanism (ROS messages are events transmitted via streams). Has anyone tried that yet ?

1 Like

Considering a ROS application a system where the behaviour is as much determined by the flow of data as it is by the way it is orchestrated is something I think many of us have been doing for a long time, precisely because – as you write – it is a natural way to think about these systems.

I’ve seen quite some applications where ROS is essentially used to physically distribute what is essentially a monolithic program with a traditional (imperative) flow of control over a set of nodes that are all tightly coupled in both time and space by just replacing regular function/method calls with RPC (services). Those typically also include some form of sampling (storing ‘the latest’ msg in a member variable, delagating the processing of data to a separate flow of control), which can lead to synchronisation issues between components and dataflows (the move_base problem with late laser scans is a famous example of this).

Perhaps it would be a good idea to expand the wiki/ROS/patterns page with some actual software patterns. Reactive (or Event Based) systems would seem to be a good candidate.

3 Likes

The roshask tool does something similar to what you ask for.

1 Like

wow, roshaskell is pretty cool, thanks for that Geoff. I’m sure Brian would remind us that if you want functional-style ROS, roslisp has been around since basically the beginning. But uh, I like the type system of Haskell a lot because talking about monads makes me feel cool.

ROS was developed before the React community came about but the frameworks seem to have come out of similar needs. It appears that the community articulated their design principles in a nice application-inspecific way: http://www.reactivemanifesto.org/

The stream abstraction in the React paradigm is great. It’s basically the abstraction of TF that I talk about sometimes. An API for reaching backwards in time across information streams is super useful and a repeated pattern in robotics and controls.

For anyone thinking about ROS 2, I saw a presentation one time where Sumant, an RTI engineer, talked about using RxCpp as an intra-process communication mechanism to be used alongside DDS. Cool ideas all around.

https://github.com/Reactive-Extensions/RxCpp

3 Likes

Thanks for the feedback. I think I ll dive into https://github.com/ReactiveX/RxPY, and check what can be done with ROS…

This is very cool topic. Recently I worked on a project related to the idea described here, which wasn’t using ROS but I’m interested in extending it to include ROS.

Have there been any more development in this space (the last comment is ~2yrs old)?

We now have RxROS (just released into Kinetic and Melodic): https://github.com/rosin-project/rxros

2 Likes