Codesys Ros2 -

The integration of CoDeSys with ROS 2 can be achieved through the use of a ROS 2 package called ros2-Industrial. This package provides a set of tools and libraries for integrating industrial controllers, including CoDeSys, with ROS 2.

In the landscape of modern automation and robotics, two software environments reign supreme, yet they speak fundamentally different languages.

On one side, we have CODESYS (Controller Development System). It is the invisible giant of industrial automation. Powering PLCs from hundreds of OEMs (including Wago, Beckhoff, Schneider Electric, and many more), CODESYS is the home of IEC 61131-3 languages (Ladder Logic, Structured Text, FBD, SFC, IL). It is deterministic, real-time, and reliable—the beating heart of factory floors, process control, and hydraulic presses.

On the other side, we have ROS 2 (Robot Operating System 2). The rebellious, open-source star of research and logistics. ROS 2 thrives on distributed computing, peer-to-peer discovery (DDS), modular nodes, and a vast ecosystem for navigation, manipulation, perception, and simulation (Gazebo, Rviz). It is the brain of autonomous mobile robots (AMRs), robotic arms, and drone swarms. codesys ros2

For a decade, engineers dreamed of merging these worlds: let the PLC handle the hard real-time I/O and safety, while ROS 2 handles the complex perception, path planning, and high-level decision-making.

The good news? The dream is now a mature reality. The "CODESYS ROS 2" integration allows these two giants to communicate seamlessly. This article explores why, how, and where you should implement it.


Let's simulate a simple project: ROS 2 sends a target speed to a CODESYS motor controller. The integration of CoDeSys with ROS 2 can

DDS is powerful but complex. Default settings may cause:

  • Robot-centric (ROS 2 master)

  • Hybrid edge device

  • Gateway-based

  • CoDeSys (Controller Development System) is a software tool for programming and configuring industrial controllers. ROS 2 (Robot Operating System 2) is an open-source software framework for building robot applications. In this post, we'll explore the integration of CoDeSys with ROS 2, enabling the use of CoDeSys controllers in ROS 2 environments.

    In a traditional setup, your Linux-based ROS computer handles Lidar and Camera data, then sends simple velocity commands (e.g., cmd_vel) to a separate PLC via Ethernet/IP or Modbus. This introduces latency. Let's simulate a simple project: ROS 2 sends

    With CODESYS ROS 2, the EtherCAT fieldbus runs directly on the same device as your ROS 2 nodes. The PLC cycle (down to 250µs) drives the motors while the ROS 2 nodes run simultaneously on the multicore processor. The result? Better trajectory tracking and immediate emergency stops.