Data Flow Design of ROS-based Software
ROS-based software inherits the hallmarks of the core framework design. These characteristics are well constructed to meet the needs of robotics software architecture. By following the best practices illustrated in the ROS communication middleware, a robotic software project can inherit complex traits such as abstraction, observability, testability, failure tolerance, interoperation and generalisation. The key elements used to construct ROS software are nodes and topics. The basic design approach is to architect data flow from node to node via topics. In general, most data will begin with sources, and end with sinks, with feedback traversing the network in reverse.
Instructions
Following a data flow approach:
- Identify sources of data, and create high-performance drivers to generate software representations of the data. Each driver will be responsible for a distinct source of data. Each driver will likely represent a node in the computation graph.
- Identify sinks - what is the outcome of an application i.e what is the goal, and what does it do? This is the end of the line. The ROS application boundary will end here, usually with a user interface or some kind of complex robotic behaviour.
- Identify how the data will be transformed. Each transformation will probably represent a node in the computation graph with a subscription and re-publication.
- Draw a diagram outlining the design using a graph of nodes and edges (topics). Pay careful attention to naming conventions and how these will become namespaces in a larger computation graph.
- Implement each node as per the diagram.
Tips:
-
Drawing the problem will help identify roles and responsibilities for nodes as well as data types, topics, and connections.
-
Keep in mind that some data will flow backwards. This is known as feedback and it is fundamentally important in most robotics applications.