ejs94 / robin

The ROS-CODESYS Bridge πŸŒ‰

Home Page:https://rosin-project.eu/ftp/robin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ROBIN

Build status ROBIN project

A ROS-CODESYS shared memory bridge to map CODESYS variables to ROS topics.

This bridge is the result of the ROBIN project, a Focused Technical Project (FTP) of the ROSIN European project.

Getting started

The bridge is made up of two components:

  • A ROS package that doesn't require any manual configuration other than the installation of its dependencies. The package contains a ROS node that reads/writes data from/to shared memory spaces and publishes/receives messages to/from ROS topics.
  • A CODESYS library to be used in a CODESYS project created by the user. An example project is provided in src/codesys/example_project.xml. The library contains a Robin function block that reads/writes data from/to shared memory spaces and writes/reads it to CODESYS user-defined variables.

The following IEC 61131-3 data types are currently supported:

  • BOOL
  • BYTE
  • SINT, INT, DINT, LINT, USINT, UINT, UDINT, ULINT
  • REAL, LREAL
  • CHAR, STRING

As well as arrays and custom structs. The following standard ROS message packages are already defined as CODESYS structs and available on the Robin CODESYS library:

These variables have to be defined on both the CODESYS project and the ROS package. For arrays or for structs with string or array members, because these data types are handled as non-POD (Plain Old Data) objects in C++, the mapping between the C++ variables and the ROS messages has to be explicitly defined. An updater application is currently under development to automate this process.

Prerequisites

Installation

  1. Create caktin workspace (if non-existent):

    mkdir -p ~/catkin_ws/src
    cd ~/catkin_ws
    catkin_make
  2. Clone repository into catkin workspace (eg. ~/catkin_ws):

    cd ~/catkin_ws/src
    git clone https://github.com/ScalABLE40/robin
  1. Install CODESYS library:
    1. Open CODESYS Development System V3
    2. Go to Tools->Library Repository->Install
    3. Find and select robin.library from the repo
    4. Close the Library Repository dialog

Usage

  1. Create CODESYS project. You can either:

    • Create your own project and add the Robin library to it.
      1. In the Devices tree, double click Library Manager and open the Add Library dialog
      2. Find and select the previously installed Robin library and click OK
      3. You can now use the Robin function block as shown in the Examples section
    • Create a new empty project and import the example project from example_project.xml.
      1. Go to Project->Import PLCopenXML...
      2. Find and select the XML file
      3. Select all items and click OK
  2. Download the CODESYS project to the PLC/SoftPLC.

  3. Restart the codesyscontrol service (if using SoftPLC):

    sudo systemctl restart codesyscontrol
  4. Update ROS package:

    1. Define any custom structs and messages in include/robin/structs.h and msg/ respectively.
    2. If using strings or arrays, define the mapping between the C++ variables and the ROS messages in src/robin/robin_inst.cpp
    3. Instantiate the Robin classes used by adding a line such as the one below to robin_inst.cpp.
      template class RobinSubscriber<double, std_msgs::Float64>;
  5. Compile ROS package and run node:

    cd ~/catkin_ws
    catkin_make robin  # or 'catkin build robin'
    rosrun robin robin

Examples

Example 1

License

License

About

The ROS-CODESYS Bridge πŸŒ‰

https://rosin-project.eu/ftp/robin

License:Apache License 2.0


Languages

Language:C++ 78.3%Language:CMake 21.7%