Hello Open Robotics Community,
I’m excited to share my latest paper, “A Modular ROS2 Gateway for CAN-based Systems: Architecture and Performance Evaluation,” which I believe addresses a critical challenge in modern robotics: the robust integration of real-time Controller Area Network (CAN) systems with higher-level robotics frameworks like ROS 2.
The Challenge:
The paper tackles the fundamental conflict between low-level fieldbuses like CAN, which ensure data integrity and real-time control, and high-level middleware like ROS 2, which offers powerful tooling but typically runs on non-real-time operating systems. Bridging this gap is essential for creating intelligent machines.
Our Approach & Contributions:
We present a novel, modular gateway architecture designed to treat the gateway as a digital twin of the CAN system. This approach aims to abstract low-level CAN complexities while preserving safety features and data fidelity. Our key contributions are threefold:
-
A novel, modular ROS 2 gateway architecture based on the digital twin pattern, providing semantic abstraction for arbitrary CAN-based systems.
-
An open-source example implementation of this architecture, offering a practical and reusable tool for the robotics community.
-
A rigorous performance evaluation of the open-source implementation on a CAN-based mobile robot, quantifying resource usage, latency, and jitter of the system.
Key Findings:
Validated on a 1:5 scale model car (the CanEduDev Rover platform, Fig. 1 in the paper), our performance evaluation revealed:
-
Average latencies of 170.4 µs and average jitter of 74.0 µs for CAN to ROS message transmission, demonstrating sub-millisecond performance suitable for soft real-time control.
-
Bimodal latency distribution and periodic performance spikes, suggesting areas for optimization, potentially related to ROS 2 middleware (e.g., FastDDS) or OS scheduling artifacts.
-
Low CPU usage overhead for the gateway application, especially with hardware-level CAN filtering.
-
Linear scaling of memory consumption with the number of nodes, primarily due to Python-based ROS nodes running in separate processes without node composition.
System Implications & Benefits:
This integration significantly lowers the barrier for simulating entire systems with tools like Gazebo. It unlocks the full potential of ROS tooling (e.g., ROS bags for data recording and analysis). Crucially, it makes the system more accessible to individuals with a robotics or research background by abstracting away low-level CAN complexities.
Limitations & Future Work:
While providing significant benefits, the current implementation has limitations, such as the lack of robust safeguards against critical ROS node crashes and the observed bimodal latency distribution. Future work will involve C++ re-implementation for better resource efficiency, detailed root cause analysis of latency variations (e.g., using ros2_tracing), and comparative analysis with different ROS middleware implementations or a PREEMPT_RT Linux kernel.
We believe this work provides a concrete design pattern and a performance roadmap for developers bridging industrial control protocols with modern robotics frameworks.
You can read the full paper here: Resources - CanEduDev
I welcome your thoughts, questions, and feedback on the architecture, performance analysis, and broader implications of this work.
Thank you!
Hashem Hashem
Co-founder, CanEduDev