Codesys Ros2 !!exclusive!! -
If your CODESYS runtime and ROS 2 are running on the same Industrial PC (IPC) under a Real-Time Linux kernel (like Preempt-RT).
As of 2025 (and looking beyond), several trends are accelerating this integration:
: PLCs excel at real-time, deterministic control. They manage microsecond-level I/O loops, execute safety functions, and communicate via robust industrial protocols like EtherCAT, PROFINET, and EtherNet/IP. However, they lack the computational flexibility needed for complex tasks like autonomous navigation, dynamic path planning, or machine learning.
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. codesys ros2
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.
Another approach is to use WebSockets to connect a CODESYS client to a ROS Bridge Server. The ROS bridge allows a CODESYS program to directly publish and subscribe to ROS 2 topics by sending specially formatted JSON messages over the WebSocket connection. For example, to publish velocity commands, the CODESYS client would first subscribe to a topic, then send a message structured like: "op":"call_service","id":"call_service:/rosapi/topic_type:1","type":"rosapi/TopicType","args":"topic":"/cmd_vel" .
ROS2 relies on DDS as its underlying communication middleware. Some modern PLC platforms and runtime extensions allow CODESYS to interact directly with DDS data spaces. By defining matching Data Writers and Data Readers inside CODESYS, the PLC can publish and subscribe directly to ROS2 topics without intermediate translation. 2. The OPC UA Bridge If your CODESYS runtime and ROS 2 are
project is a dedicated bridge designed specifically for ROS and CODESYS. How it works
3. Implementing the CODESYS ROS2 Bridge: A Step-by-Step Overview
Within the CODESYS Development System, the next step is to implement the logic for receiving data from and sending data to ROS 2. In a CODESYS program, a programmer might create a reference to a publisher object and a Twist message object, which is then populated with data and published. However, they lack the computational flexibility needed for
Many CODESYS-compatible controllers support OPC UA , which can be bridged to ROS 2 using standard nodes like ros2_opcua_gateway .
Hybrid edge device
manages high-level logic, SLAM, and visualization through its distributed node system. Popular Integration Methods
: AMRs navigate the warehouse floor using ROS2 Nav2. When the AMR arrives at a loading dock, it links with a CODESYS-controlled conveyor system to coordinate the safe, automated transfer of heavy freight.
