RossROS

RossROS is a minimal robot operating system designed to teach principles of concurrent interactions between sensing, processing and acting elements of a system

View the Project on GitHub rlhatton/RossROS

RossROS

RossROS is a minimal robot operating system designed to teach principles of concurrent interactions between sensing, processing and acting elements of a system.

Why Use RossROS?

RossROS is a lightweight means of constructing a set of multitasked processes, passing messages with a publish-subscribe model (conceptually similar to the “topics” model used in ROS). Its design is targeted at two main educational use-cases:

Provided Files

The core RossROS functionality is provided in rossros.py, with an example of code using the library provided in rossros_demo.py. An alternative implementation (using cooperative multitasking) is provided as rossros_asyncio.py, and demonstrated in rossros_asyncio_demo.py.

Documentation for RossROS is provided in:

Components

The core components of RossROS are two python classes – message buses and consumer-producers.

RossROS additionally provides several additional classes derived from the consumer-producer class:

Using RossROS

To set up a system using RossROS:

It is often useful to additionally:

The file rr_demo.py provides a commented example of this process.

Pre-emptive and cooperative multitasking

The core rossros.py library uses pre-emptive multitasking, implemented via the concurrent.futures Python package.

An alternative library, rossros_asyncio.py, instead uses cooperative multitasking, implemented via the asyncio Python package.

Systems set up with rossros.py should be able to seamlessly transition to using rossros_asyncio.py simply by changing the relevant “import” line in the code, and it can be instructive to compare the behavior of the system under the two approaches to multitasking.

Note that when using cooperative multitasking, the default behavior for a consumer-producer is to retain control of the processor for the complete “collect input data, execute the function, and deal output data” operation. For a function that takes a significant length of time to complete, you can let the function release the processor at intermediate points by including calls to “await.sleep” within the functions (but note that any such calls will stack with the loop delay time, so that you should decrease the loop delay to keep the same overall execution frequency).