Codesys Ros2 [2021] < 2024 >
By effectively distributing the workload—having CODESYS manage the deterministic, low-level hardware and ROS 2 handle the complex, high-level intelligence—you can build a more reliable, powerful, and efficient robotic system.
ROS2 data types are strictly defined. Ensure strict mapping to CODESYS types to avoid data loss.
Thanks to the , you no longer have to choose.
3. Implementing the CODESYS ROS2 Bridge: A Step-by-Step Overview
Native integration, high performance, no intermediate bridging software required. codesys ros2
In the control room, the ladder diagrams still scrolled in their slow, steady rhythm. In the racks of compute by the loading bay, ROS 2 logs bloomed like busy city traffic. Between them, the translator hummed, a silent mediator that let old certainties and new possibilities share the same floor. And as long as the heartbeat protocol stayed true and the watchdog remained vigilant, the factory would keep humming—human oversight, deterministic control, and autonomous cognition, together, making the impossible routine.
Integrating CODESYS and ROS 2 provides a powerful solution for modern robotics and automation. The key takeaways are:
Available as an add‑on library for CODESYS V3.5 SP20+. Free for non‑commercial use (limited to 10 variables); professional license per runtime.
Call the Robin function block in your cyclic task (e.g., every 10ms or 200Hz) to synchronize data. Phase 2: Preparing ROS2 Thanks to the , you no longer have to choose
Never let the asynchronous nature of ROS2 stall a real-time CODESYS task. Design the PLC code to use fallback logic. If the ROS2 bridge fails to update a target coordinate within a designated watchdog time frame (e.g.,
subgraph main_pc [<b>Main Processing Unit (Linux/ROS 2 PC)</b>] ros2[<b>ROS 2 Stack</b><br/>▪ Navigation2 / MoveIt 2<br/>▪ SLAM & Perception<br/>▪ High-level Decision Making] bridge[<b>ROBIN ROS 2 Wrapper Node</b><br/>▪ Communicates via shared memory<br/>▪ Translates CODESYS <-> ROS 2 msgs] end
In response to the need for a dedicated, high-performance bridge, the project was created. Developed initially within the European ROSIN project, ROBIN is an open-source middleware designed specifically to provide a bidirectional, reliable, and structured real-time communication link between ROS and CODESYS. ROBIN utilizes the EtherLab Master Module API for the EtherCAT protocol to establish a high-speed real-time channel.
Let's simulate a simple project: ROS 2 sends a target speed to a CODESYS motor controller. In the control room, the ladder diagrams still
Which you prefer to use (OPC UA, MQTT, or Shared Memory)
Integrating CODESYS with ROS2 allows engineers to combine industrial reliability with cutting-edge algorithmic intelligence. This architecture solves several modern automation challenges:
: CODESYS features a built-in, highly optimized OPC UA server.
ROS 2 is the industry standard for robot development, featuring a distributed architecture built on the Data Distribution Service (DDS) that enhances its fault tolerance and real-time performance.