How jensvanhooydonck/ethercat_driver_ros2 works
Project type and purpose
• This is an open-source ROS 2 driver stack (“ethercat_driver_ros2”) that provides a Hardware Interface for integrating EtherCAT modules with ros2_control.
• It builds on the IgH EtherCAT Master for Linux and exposes generic, plugin-based drivers (CIA402 drives, generic slaves) plus management layers and ROS 2 services (GetSdo/SetSdo).
File structure
• Top-level directories:
• .docker (Dockerfile + docs for containerized CI)
• .github (CI workflows)
• ethercat_driver (core C++ plugin layer)
• ethercat_driver_ros2 (the ROS 2 node/HW interface + docs)
• ethercat_generic_plugins (two subfolders for CIA402 drive & generic slave)
• ethercat_interface (abstraction over IgH EtherCAT Master)
• ethercat_manager (async manager + ROS 2 SDO service server)
• ethercat_msgs (ROS 2 service definitions for SDO)
• Each package uses standard CMakeLists.txt + package.xml → ROS 2 workspace layout.
• There are test folders under interface and generic_plugins, plus Doxygen & Sphinx docs in the ros2 package.
README for additional insights
• The driver plugs into ros2_control as a Hardware Interface.
• Plugins are parameterized by YAML/config files (in doc quickstart).
• Underlying comms rely on IgH EtherCAT Master → real-time bus.
a. Main components to include:
1) ros2_control Framework (controller manager + controllers)
2) ethercat_driver_ros2 Node (implements HardwareInterface)
3) ethercat_manager (async I/O & SDO service server)
4) ethercat_interface Library (wrapper over IgH EtherCAT Master API)
5) ethercat_driver Core Plugin Loader (loads XML plugin descriptors)
6) ethercat_generic_plugins (CIA402 Drive, Generic Slave modules)
7) IgH EtherCAT Master (user-space daemon / kernel module)
8) Physical EtherCAT Network + Slaves (motors, I/O modules)
9) ethercat_msgs (GetSdo/SetSdo service definitions)
10) Configuration files (YAML, plugin XML)
b. Relationships & interactions:
• ros2_control → calls HardwareInterface APIs in ethercat_driver_ros2
• ethercat_driver_ros2 → uses ethercat_manager for read/write cycles & SDO services
• ethercat_manager → uses ethercat_interface to interact with underlying IgH API
• ethercat_interface → issues PDO/SDO requests to IgH Master → bus → slaves
• At startup, ethercat_driver core reads plugin XML → instantiates generic_plugins
• Users can call ROS 2 services (GetSdo/SetSdo) provided by ethercat_manager
c. Architectural patterns / design principles:
• Layered abstraction (ros2_control → driver_ros2 → manager → interface → master)
• Plugin architecture (generic_plugins loaded via XML descriptors)
• Separation of concerns (I/O scheduling in manager vs. low-level access in interface)
• ROS 2 middleware for messaging & service orchestration
d. Key technologies/frameworks:
• C++, CMake, colcon build
• ROS 2 (rclcpp, ros2_control, custom messages/services)
• IgH EtherCAT Master
• Doxygen (C++ API docs) & Sphinx (user/developer guides)
• Docker (containerized CI) & GitHub Actions
Final advice
• Explicitly show plugin points and SDO service endpoints.
• Configuration & build artifacts (CMake, package.xml) in a corner to acknowledge the build/deploy layer.