Real-time interaction with uncertain and dynamic environments is essential for robotic systems to achieve functions such as visual perception, force interaction, spatial obstacle avoidance, and motion planning. To ensure the reliability and determinism of system execution, a flexible real-time control system architecture and interaction algorithm are required. The ROS framework was designed to improve the reusability of robotic software development by providing a distributed structure, hardware abstraction, message-passing mechanism, and application prototypes. Rich ecosystems for robotic development have been built around ROS1 and ROS2 architectures based on the Linux system. However, because of the fairness scheduling principle of the default Linux system design and the complexity of the kernel, the system does not have real-time computing. To achieve a balance between real-time and non-real-time computing, this paper uses the transmission mechanism of ROS2, combines it with the scheduling mechanism of the Linux operating system, and uses Preempt_RT to enhance the real-time computing of ROS1 and ROS2. The real-time performance evaluation of ROS1 and ROS2 is conducted from multiple perspectives, including throughput, transmission mode, QoS service quality, frequency, number of subscription nodes and EtherCAT master. This paper makes two significant contributions: firstly, it employs Preempt_RT to optimize the native ROS2 system, effectively enhancing the real-time performance of native ROS2 message transmission; secondly, it conducts a comprehensive evaluation of the real-time performance of both native and optimized ROS2 systems. This comparison elucidates the benefits of the optimized ROS2 architecture regarding real-time performance, with results vividly demonstrated through illustrative figures.
与不确定和动态环境的实时互动对于机器人系统以实现视觉感知,力相互作用,空间障碍避免和运动计划等功能至关重要。为了确保系统执行的可靠性和确定性,需要灵活的实时控制系统体系结构和交互算法。 ROS框架旨在通过提供分布式结构,硬件抽象,消息通讯机制和应用程序原型来提高机器人软件开发的可重复性。机器人开发的丰富生态系统是基于Linux系统围绕ROS1和ROS2体系结构构建的。但是,由于默认Linux系统设计的公平计划原理和内核的复杂性,该系统没有实时计算。为了在实时计算和非实时计算之间达到平衡,本文使用ROS2的传输机制,将其与Linux操作系统的调度机制相结合,并使用Preekpert_RT来增强ROS1和ROS1的实时计算ROS2。 ROS1和ROS2的实时性能评估是从多个角度进行的,包括吞吐量,传输模式,QoS服务质量,频率,订阅节点的数量和Ethercat Master。本文做出了两个重要的贡献:首先,它采用PreemenT_RT来优化本机ROS2系统,从而有效增强了本机ROS2消息传输的实时性能;其次,它对天然和优化ROS2系统的实时性能进行了全面评估。这种比较阐明了优化的ROS2体系结构在实时性能方面的好处,结果通过说明性数字生动地证明了结果。