Deadline-Driven Enhancements and Response Time Analysis of ROS2 Multi-threaded Executors
摘要
The second-generation Robot Operating System, ROS2, has gained significant interest due to its enhanced real-time capabilities. Although some studies are conducted on ROS2 multi-threaded executors to improve real-time capabilities, the existing scheduling schemes of multi-threaded executors may incur high latency for low-priority chains and priority inversion. Therefore, it remains a challenging problem to meet the real-time constraints of chain instances for multi-threaded executors. In this paper, we design a Chain-Instance-Level Earliest Deadline First (CIL-EDF) scheduling scheme for multi-threaded executors and present a comprehensive response time analytical model (RTAM) for the proposed scheduler; In this scheduler, callback instances are prioritized based on the corresponding chain instances of deadline to meet the real-time constraints for chain instances. Besides, the proposed RTAM is capable of analyzing chains with both arbitrary and constrained deadlines, as well as accounting for the impact of mutually-exclusive callback groups. To validate the scheduler and analytical model, we conduct a series of case studies. The results demonstrate the CIL-EDF outperforms the default and Chain-Level scheduling schemes of multi-threaded executors in terms of worst-case response time and schedulability, and the RTAM can safely upper-bound response times under all chain instances that are schedulable in the system.