PiCAS: New Design of Priority-Driven Chain-Aware Scheduling for ROS2

In ROS (Robot Operating System), most applications in time- and safety-critical domain are constructed in the form of callback chains with data dependencies. Due to the shortcomings in its real-time support, ROS does not provide a strong timing guarantee and may lead to disastrous results. Although ROS2 claims to enhance the real-time capability, ensuring predictable end-to-end chain latency still remains a challenging problem. In this paper, we propose a new priority-driven chain-aware scheduler for the ROS2 framework and present end-to-end latency analysis for the proposed scheduler. With our scheduler, callbacks are prioritized based on the given timing requirements of the corresponding chains so that the end-to-end latency of critical chains can be improved with a predictable bound. The proposed scheduling design includes priority assignment and resource allocation considering all ROS2 scheduling-related abstractions, e.g., callbacks, nodes, and executors. To the best of our knowledge, this is the first work to address the inherent limitations of ROS2 in end-to-end latency by proposing a new scheduler design. We have implemented our scheduler in ROS2 running on NVIDIA Xavier NX. We have conducted case studies and schedulability experiments. The results show that the proposed scheduler yields a substantial improvement in end-to-end latency over the default ROS2 scheduler and the latest work in real-world scenarios.

[1]  Dennis Shasha,et al.  Skip-Over: algorithms and complexity for overloaded systems that allow skips , 1995, Proceedings 16th IEEE Real-Time Systems Symposium.

[2]  Giorgio C. Buttazzo,et al.  Measuring the Performance of Schedulability Tests , 2005, Real-Time Systems.

[3]  Qi Zhu,et al.  Job-Class-Level Fixed Priority Scheduling of Weakly-Hard Real-Time Systems , 2019, 2019 IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS).

[4]  Lander Usategui San Juan,et al.  Towards a distributed and real-time framework for robots: Evaluation of ROS 2.0 communications for real-time robotic applications , 2018, ArXiv.

[5]  Alberto L. Sangiovanni-Vincentelli,et al.  Period Optimization for Hard Real-time Distributed Automotive Systems , 2007, 2007 44th ACM/IEEE Design Automation Conference.

[6]  Yukihiro Saito,et al.  Priority and Synchronization Support for ROS , 2016, 2016 IEEE 4th International Conference on Cyber-Physical Systems, Networks, and Applications (CPSNA).

[7]  Jindong Tan,et al.  RT-ROS: A real-time ROS architecture on multi-core processors , 2016, Future Gener. Comput. Syst..

[8]  Hyoseung Kim,et al.  Chain-Based Fixed-Priority Scheduling of Loosely-Dependent Tasks , 2020, 2020 IEEE 38th International Conference on Computer Design (ICCD).

[10]  Thomas Nolte,et al.  Synthesizing Job-Level Dependencies for Automotive Multi-rate Effect Chains , 2016, 2016 IEEE 22nd International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA).

[11]  Yves Sorel,et al.  Latency analysis for data chains of real-time periodic tasks , 2018, 2018 IEEE 23rd International Conference on Emerging Technologies and Factory Automation (ETFA).

[12]  Rolf Ernst,et al.  Response-Time Analysis for Task Chains in Communicating Threads , 2016, 2016 IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS).

[13]  Shinpei Kato,et al.  Exploring the performance of ROS2 , 2016, 2016 International Conference on Embedded Software (EMSOFT).

[14]  Hyoseung Kim,et al.  Predictable Shared Cache Management for Multi-Core Real-Time Virtualization , 2017, ACM Trans. Embed. Comput. Syst..

[15]  Björn Andersson,et al.  Schedulability Analysis of Tasks with Corunner-Dependent Execution Times , 2018, ACM Trans. Embed. Comput. Syst..

[16]  Shinpei Kato,et al.  ROSCH:Real-Time Scheduling Framework for ROS , 2018, 2018 IEEE 24th International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA).

[17]  Björn Andersson,et al.  Bounding memory interference delay in COTS-based multi-core systems , 2014, 2014 IEEE 19th Real-Time and Embedded Technology and Applications Symposium (RTAS).

[18]  Rolf Ernst,et al.  System level performance analysis - the SymTA/S approach , 2005 .

[19]  Michael González Harbour,et al.  Exploiting precedence relations in the schedulability analysis of distributed real-time systems , 1999, Proceedings 20th IEEE Real-Time Systems Symposium (Cat. No.99CB37054).

[20]  C.S. Wong,et al.  Fairness and interactive performance of O(1) and CFS Linux kernel schedulers , 2008, 2008 International Symposium on Information Technology.

[21]  Ingo Lütkebohle,et al.  Response-Time Analysis of ROS 2 Processing Chains Under Reservation-Based Scheduling , 2019, ECRTS.

[22]  Wang Yi,et al.  Worst-Case Cause-Effect Reaction Latency in Systems with Non-Blocking Communication , 2019, 2019 Design, Automation & Test in Europe Conference & Exhibition (DATE).

[23]  Rolf Ernst,et al.  Budgeting Under-Specified Tasks for Weakly-Hard Real-Time Systems , 2017, ECRTS.

[24]  Michael González Harbour,et al.  Schedulability analysis for tasks with static and dynamic offsets , 1998, Proceedings 19th IEEE Real-Time Systems Symposium (Cat. No.98CB36279).