Skip to content

2. ROS Setup & Interface

Frantisek Durovsky edited this page Jun 29, 2017 · 3 revisions

This package was originally developed and tested on ROS Indigo and Ubuntu 14.04 LTS, but the combination of ROS Kinetic and Ubuntu 16.04 LTS should also work.

1. Building the sources

Assuming that your workspace is located at /home/user/catkin_ws/ git clone ros_powerlink package to your src folder

$ cd ~/catkin_ws/src/
$ git clone https://github.com/SmartRoboticSystems/ros_powerlink.git

Before compilation you need to adopt OPLK_BASE_DIR path in CMakeLists.txt.

Edit line 4 to meet your POWERLINK folder path:

SET(OPLK_BASE_DIR /home/user/openPOWERLINK_V2.5.2).

Now compile using catkin_make as usual

 $ cd ~/catkin_ws/    
 $ catkin_make

If build succeeded, ros_powerlink package is ready for use.

2. ROS Interface

ros_powerlink package provides bridge between ROS topics and CiA401 profile. For this purpose custom ROS message type named openPowerlinkMsg is utilized.

2.1 openPowerlinkMsg structure:

openPowerlinkMsg follows CiA401 profile definition and only adopts data types to meet the ROS standards:

std_msgs/Header header
uint8[4] digital_array_AU8
int8[4] analogue_array_AI8
int16[2] analogue_array_AI16
int32 analogue_value_AI32

2.2 Subscribed topic

If you want to send data from you ROS application over POWERLINK, publish data to following topic:

  • Topic name: powerlink/data_to_plc
  • Topic type: ros_powerlink::openPowerlinkMsg

2.3 Published topic

If you want to read data received from PLC by your ROS application, subscribe to following topic:

  • Topic name: powerlink/data_from_plc
  • Topic type: ros_powerlink::openPowerlinkMsg

3. Where to go next

Next step: 3. B&R Automation Studio