User Tools

Site Tools


getting_started:tutorials:systemros1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:tutorials:systemros1 [2023/02/09 10:38] – [Publishing] ursgrafgetting_started:tutorials:systemros1 [2024/12/06 18:53] (current) ursgraf
Line 1: Line 1:
 ====== Control System Talking to ROS ====== ====== Control System Talking to ROS ======
  
-EEROS can work with ROS1 or ROS2. However, you have to make sure, that you compile EEROS with support for the right version of ROS. Further, the naming and use of the ROS tools have changed.+EEROS can work with ROS1 or ROS2. However, you have to make sure, that you compile EEROS with support for the right version of ROS. Further, the naming and use of the tools in ROS1 and ROS2 have slightly changed.
  
 ===== Using ROS1 ===== ===== Using ROS1 =====
Line 20: Line 20:
 IMPORTANT You have to run a program using real time threads with root privileges.  IMPORTANT You have to run a program using real time threads with root privileges. 
 ==== Publishing ==== ==== Publishing ====
-This example runs your EEROS application as a ROS node under the name ///eerosNode//. It publishes three topics +This example runs your EEROS application as a ROS node under the name ///eerosNode//. It publishes six topics 
-  * /test/vector          (of type Matrix<7,1,double>+  * /test/analogSignal          (of type eeros_msgs/msg/AnalogSignal with a single double value
-  * /test/val             (of type double) +  * /test/analogSignalVector    (of type eeros_msgs/msg/AnalogSignal with a vector of 7 entries of type double
-  * /test/safetyLevel     (of type unit32_t)+  * /test/digitalSignal          (of type eeros_msgs/msg/DigitalSignal with a single bool value) 
 +  * /test/digitalSignalVector    (of type eeros_msgs/msg/DigitalSignal with a vector of 7 entries of type bool
 +  * /test/safetyLevel     (currently active safety level of type std_msgs/msg/String) 
 +  * /test/odom     (odometry data of type nav_msgs/msg/Odometry)
  
 With  With 
Line 33: Line 36:
 $ rostopic list $ rostopic list
 </code> </code>
-will list the three topics which are published be our node, ///test/val//, ///test/vector//, and ///test/safetyLevel//.+will list all the topics which are published be our node.
 Open another shell to show the messages sent by EEROS, e.g. Open another shell to show the messages sent by EEROS, e.g.
 <code> <code>
-$ rostopic echo /test/vector+$ rostopic echo /test/analogSignalVector
 </code> </code>
 With  With 
 <code> <code>
-$ rostopic hz /test/val+$ rostopic hz /test/analogSignalVector
 </code> </code>
 you can easily check how often data is sent from out ROS node. Try to plot the data with you can easily check how often data is sent from out ROS node. Try to plot the data with
 <code> <code>
-$ rqt_plot /test/val /test1/vector/data[0] /test/vector/data[1] /test/safetyLevel+$ rqt_plot /test/analogSignal /test/analogSignalVector/val[0] /test/analogSignalVector/val[1] /test/safetyLevel
 </code> </code>
  
Line 79: Line 82:
   * /test/vector          (of type Matrix<7,1,double>)   * /test/vector          (of type Matrix<7,1,double>)
   * /test/val             (of type double)   * /test/val             (of type double)
-  * /test/safetyLevel     (of type unit32_t)+  * /test/safetyLevel     (of type string)
  
 With  With 
Line 92: Line 95:
 Open another shell to show the messages sent by EEROS, e.g. Open another shell to show the messages sent by EEROS, e.g.
 <code> <code>
-rostopic echo /test/vector+ros2 topic echo /test/vector
 </code> </code>
 With  With 
 <code> <code>
-rostopic hz /test/val +ros2 topic hz /test/val
-</code> +
-you can easily check how often data is sent from out ROS node. Try to plot the data with +
-<code> +
-$ rqt_plot /test/val /test1/vector/data[0] /test/vector/data[1] /test/safetyLevel+
 </code> </code>
 +you can easily check how often data is sent from out ROS node. 
  
 ==== Subscribing ==== ==== Subscribing ====
Line 109: Line 109:
 and logs its transported message values into the console. Alternatively you could publish a single message from the command line with  and logs its transported message values into the console. Alternatively you could publish a single message from the command line with 
 <code> <code>
-rostopic pub /rosNodeTalker/val std_msgs/Float64 -- -2.3 +ros2 topic pub /rosNodeTalker/val example_interfaces/msg/Float64 "data: -2.3" 
-rostopic pub /rosNodeTalker/vector std_msgs/Float64MultiArray "{layout: {dim: [], data_offset: 0}, data: [2.5, 1.76]}"+ros2 topic pub /rosNodeTalker/vector example_interfaces/msg/Float64MultiArray "{layout: {dim: [], data_offset: 0}, data: [2.5, 1.76]}"
 </code> </code>
  
 Use Use
 <code> <code>
-rqt_graph+rqt
 </code> </code>
-to show a graph with all involved nodes together with their topics.+to show a graph with all involved nodes together with their topics or to plot messages.
  
getting_started/tutorials/systemros1.1675935487.txt.gz · Last modified: 2023/02/09 10:38 by ursgraf