ROS 2 is a well-known software framework for the development of robotic applications. The open-source project enjoys active interest and participation from both academia and industry in applications spanning from autonomous vehicles to industrial robotics. ROS 2's success is unde
...
ROS 2 is a well-known software framework for the development of robotic applications. The open-source project enjoys active interest and participation from both academia and industry in applications spanning from autonomous vehicles to industrial robotics. ROS 2's success is underpinned by its disposition for collaborative development as well as its rich third-party package system. This has enabled developers to rapidly design, apply, and share their work while abstracting away the tedium of reimplementing common software constructs. Since the incarnation of ROS 1, ROS has shifted its focus away from medium-power workstations towards embedded systems. These efforts have born out ROS 2, a revision of the original ROS concept with a goal of supporting real-time applications.
Unfortunately, ROS 2 suffers from several major drawbacks that diminish its feasibility for applications with real-time requirements. Its idomatic C++ library contains an executor with a noncomformant callback scheduling model, which is neither priority aware or capable of preemptive callback execution. This makes ROS 2 considerably less time-predictable, as high-priority callbacks may suffer from priority inversions, and common real-time scheduling policies cannot be applied. Furthermore, ROS 2 is built upon a distributed messaging system, with system functions split across callbacks linked through a publish-subscribe communication mechanism. This frustrates the development of solutions for ROS, as it still requires developers cope with distributed chains of execution that must contend with precedence relations, synchronisation devices, and message passing overhead.
In response to these deficiencies, this thesis presents five major contributions: (1) two new executor implementations, with support for both callback prioritisation and preemptive callback execution. (2) a new priority-synthesis algorithm, which uses a graph model to map a set of callback-chain priorities to callbacks within ROS applications. (3) A simple feasibility test for ROS 2 applications based on callback chains. (4) A schedulability test for ROS 2 applications with harmonic chains. (5) A novel testing framework, which integrates the priority-synthesis algorithm, and enables the easy and rapid generation of test applications for development purposes.
The evaluation reveals that the new executors deliver superior performance in metrics such as worst-case response time, deadline misses, and jitter. On applications with up to 60% utilisation under rate-monotonic scheduling, the new executor implementations deliver no deadline misses, as opposed to the standard executor encountering them at just 10%. Finally, on high priority chains, the new executors can deliver up to 1300% times less jitter over the standard.