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:35] – [Using ROS2] ursgrafgetting_started:tutorials:systemros1 [2023/02/27 14:00] (current) – [Subscribing] 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 33: Line 33:
 $ rostopic list $ rostopic list
 </code> </code>
-will list the two topics which are published be our node, ///test/val//, ///test/vector//, and ///test/safetyLevel//.+will list the three topics which are published be our node, ///test/val//, ///test/vector//, and ///test/safetyLevel//.
 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>
Line 83: Line 83:
 With  With 
 <code> <code>
-rosnode list+ros2 node list
 </code> </code>
 you will see the new node.  you will see the new node. 
 <code> <code>
-rostopic list+ros2 topic list
 </code> </code>
-will list the two topics which are published be our node, ///test/val//, ///test/vector//, and ///test/safetyLevel//.+will list the three topics which are published be our node, ///test/val//, ///test/vector//, and ///test/safetyLevel//.
 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 106:
 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 std_msgs/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 std_msgs/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.1675935305.txt.gz · Last modified: 2023/02/09 10:35 by ursgraf