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

From ESS-WIKI
Jump to: navigation, search
(Created page with " <br/> = 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 an...")
 
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  
<br/> = Introduction =
+
= 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.
+
The message definition of ROS2 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.
  
 
&nbsp;
 
&nbsp;
  
== Message definition ==
+
= Message definition =
  
 
'''AdvSensor.msg'''
 
'''AdvSensor.msg'''
Line 12: Line 12:
 
The file AdvSensor.msg is a message definition that holds a detail hardware sensor data that Advantech device/board provided.
 
The file AdvSensor.msg is a message definition that holds a detail hardware sensor data that Advantech device/board provided.
  
&nbsp;<br/> <pre># This is a message that holds a detail hardware sensor data that Advantech device/board provided.<br/> #<br/> string &nbsp; &nbsp;sensor &nbsp; &nbsp;# Sensor name<br/> string &nbsp; &nbsp;type &nbsp; &nbsp; &nbsp;# Sensor type: "v", "bv" or "sv"<br/> bool &nbsp; &nbsp; &nbsp;bv &nbsp; &nbsp; &nbsp; &nbsp;# Boolean type of sensor value&nbsp;<br/> float64 &nbsp; v &nbsp; &nbsp; &nbsp; &nbsp; # Number type of sensor value&nbsp;<br/> string &nbsp; &nbsp;sv &nbsp; &nbsp; &nbsp; &nbsp;# String type of sensor value&nbsp;<br/> uint64 &nbsp; &nbsp;ts &nbsp; &nbsp; &nbsp; &nbsp;# Timestamp od sensor value<br/> </pre>
+
&nbsp;
 +
<pre># 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
 +
</pre>
  
 
&nbsp;
 
&nbsp;
  
== Action definition ==
+
= Action definition =
  
 
'''AdvSensorSet.action'''
 
'''AdvSensorSet.action'''
Line 24: Line 33:
 
&nbsp;
 
&nbsp;
  
{| border="1" cellpadding="1" cellspacing="1" width="887"<br/> |-<br/> | style="width: 47px; text-align: center" | '''<span style="font-size:larger">Action Type</span>'''<br/> | style="width: 63px; text-align: center" | '''<span style="font-size:larger">Action name</span>'''<br/> | style="width: 85px; text-align: center" | '''<span style="font-size:larger">Action File</span>'''<br/> |-<br/> | style="width: 47px; text-align: center" | <span style="font-size:larger">adv_msgs/action/AdvSensorSet</span><br/> | style="width: 63px; text-align: center" | <span style="font-size:larger">adv_sensor_set</span><br/> | style="width: 85px; text-align: center" | <span style="font-size:larger">AdvSensorSet.action</span><br/> |}
+
{| border="1" cellpadding="1" cellspacing="1" width="887"
 +
|-
 +
| style="width: 47px; text-align: center" | '''<span style="font-size:larger">Action Type</span>'''
 +
| style="width: 63px; text-align: center" | '''<span style="font-size:larger">Action name</span>'''
 +
| style="width: 85px; text-align: center" | '''<span style="font-size:larger">Action File</span>'''
 +
|-
 +
| style="width: 47px; text-align: center" | <span style="font-size:larger">adv_msgs/action/AdvSensorSet</span>
 +
| style="width: 63px; text-align: center" | <span style="font-size:larger">adv_sensor_set</span>
 +
| style="width: 85px; text-align: center" | <span style="font-size:larger">AdvSensorSet.action</span>
 +
|}
  
&nbsp;<br/> <pre># This is a request/response/feedback that holds a detail hardware sensor data that Advantech device/board provided.<br/> #<br/> string &nbsp; &nbsp;cmd &nbsp; &nbsp; &nbsp; # Request command of set sensor value<br/> string &nbsp; &nbsp;sensor &nbsp; &nbsp;# Sensor name of set request<br/> string &nbsp; &nbsp;type &nbsp; &nbsp; &nbsp;# Sensor type: "v", "bv" or "sv"<br/> bool &nbsp; &nbsp; &nbsp;bv &nbsp; &nbsp; &nbsp; &nbsp;# Boolean type of sensor value<br/> float64 &nbsp; v &nbsp; &nbsp; &nbsp; &nbsp; # Number type of sensor value<br/> string &nbsp; &nbsp;sv &nbsp; &nbsp; &nbsp; &nbsp;# String type of sensor value<br/> ---<br/> int16 &nbsp; &nbsp; code &nbsp; &nbsp; &nbsp;# Result code, request accept: 100, unaccept: code > 100<br/> ---<br/> int16 &nbsp; &nbsp; status &nbsp; &nbsp;# Status feedback of set sensor request<br/> string &nbsp; &nbsp;sensor &nbsp; &nbsp;# Sensor name feedback of set request<br/> string &nbsp; &nbsp;info &nbsp; &nbsp; &nbsp;# Information feedback of set request<br/> uint64 &nbsp; &nbsp;ts &nbsp; &nbsp; &nbsp; &nbsp;# Timestamp of sensor value<br/> </pre>
+
&nbsp;
 +
<pre># 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
 +
</pre>
  
 
&nbsp;
 
&nbsp;
  
== Setup message ==
+
= Setup Message =
  
 
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 foxy environmant setup file:<br/> <pre>$ source /opt/ros/foxy/setup.bash<br/> </pre>
+
1. Setup ROS2 environmant variables:
 +
<pre>$ source /opt/ros/${ROS_DISTRO}/setup.bash
 +
</pre>
  
 
&nbsp;
 
&nbsp;
  
2. Sourcing node setup file:<br/> <pre>$ source /usr/local/Advantech/ros/foxy/include/edge-converter-ros2/adv_msgs/install/local_setup.bash<br/> </pre>
+
2. Setup ROS2 message definition:
 +
<pre>$ source /usr/local/Advantech/ros/${ROS_DISTRO}/include/edge-converter-ros2/adv_msgs/install/local_setup.bash
 +
</pre>
  
 
&nbsp;
 
&nbsp;
 
[[Category:Editor]]<br/> &nbsp;
 

Latest revision as of 04:24, 5 March 2024

Introduction

The message definition of ROS2 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 Message

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

1. Setup ROS2 environmant variables:

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

 

2. Setup ROS2 message definition:

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