Difference between revisions of "Advantech Robotic Suite/Advantech ROS2 Data Format"

From ESS-WIKI
Jump to: navigation, search
Line 68: Line 68:
 
This section will introduct you how to setup node in your environmant.
 
This section will introduct you how to setup node in your environmant.
  
1. Sourcing ROS2 environmant setup file:
+
1. Setup ROS2 environmant variables, replace ${ROS_DISTRO} with your ROS2 distribution (foxy, humble) to run this command:
 
<pre>$ source /opt/ros/${ROS_DISTRO}/setup.bash
 
<pre>$ source /opt/ros/${ROS_DISTRO}/setup.bash
 
</pre>
 
</pre>
Line 74: Line 74:
 
&nbsp;
 
&nbsp;
  
2. Sourcing node setup file:
+
2. Setup Advantech ROS2 message definition:
 
<pre>$ source /usr/local/Advantech/ros/${ROS_DISTRO}/include/edge-converter-ros2/adv_msgs/install/local_setup.bash
 
<pre>$ source /usr/local/Advantech/ros/${ROS_DISTRO}/include/edge-converter-ros2/adv_msgs/install/local_setup.bash
 
</pre>
 
</pre>
  
 
&nbsp;
 
&nbsp;

Revision as of 07:28, 24 May 2023

Introduction

The message definition of Advantech ROS node are located in include/adv_msgs folder, message file (.msg) is defined for node data publish/subscribe and action file (.action) is defined for setting sensor data.

 

Message definition

AdvSensor.msg

The file AdvSensor.msg is a message definition that holds a detail hardware sensor data that Advantech device/board provided.

 

# This is a message that holds a detail hardware sensor data that Advantech device/board provided.
#
string    sensor    # Sensor name
string    type      # Sensor type: "v", "bv" or "sv"
bool      bv        # Boolean type of sensor value 
float64   v         # Number type of sensor value 
string    sv        # String type of sensor value 
uint64    ts        # Timestamp od sensor value

 

Action definition

AdvSensorSet.action

The file AdvSensorSet.action' is a request/response/feedback that holds a detail hardware sensor data that Advantech device/board provided.

 

Action Type Action name Action File
adv_msgs/action/AdvSensorSet adv_sensor_set AdvSensorSet.action

 

# This is a request/response/feedback that holds a detail hardware sensor data that Advantech device/board provided.
#
string    cmd       # Request command of set sensor value
string    sensor    # Sensor name of set request
string    type      # Sensor type: "v", "bv" or "sv"
bool      bv        # Boolean type of sensor value
float64   v         # Number type of sensor value
string    sv        # String type of sensor value
---
int16     code      # Result code, request accept: 100, unaccept: code > 100
---
int16     status    # Status feedback of set sensor request
string    sensor    # Sensor name feedback of set request
string    info      # Information feedback of set request
uint64    ts        # Timestamp of sensor value

 

Setup

This section will introduct you how to setup node in your environmant.

1. Setup ROS2 environmant variables, replace ${ROS_DISTRO} with your ROS2 distribution (foxy, humble) to run this command:

$ source /opt/ros/${ROS_DISTRO}/setup.bash

 

2. Setup Advantech ROS2 message definition:

$ source /usr/local/Advantech/ros/${ROS_DISTRO}/include/edge-converter-ros2/adv_msgs/install/local_setup.bash