User Tools

Site Tools


getting_started:ros_example

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:ros_example [2024/12/10 08:17] – [Working with ROS2] ursgrafgetting_started:ros_example [2026/01/27 10:23] (current) – [Building] ursgraf
Line 36: Line 36:
   ...   ...
   ControlSystem cs(node, dt);   ControlSystem cs(node, dt);
 +  ...
 +  signal(SIGINT, signalHandler);
   ...   ...
 </code> </code>
  
 When defining a control system which uses ROS subscriber or publisher blocks, you have to pass this node to them. When defining a control system which uses ROS subscriber or publisher blocks, you have to pass this node to them.
- +All ROS tools such as ''rqt'' will list your EEROS application under the name ''eerosNode''. The variable ''node'' has to be passed to all blocks in the control system which publish or subscribe to ROS messages. \\
-All ROS tools such as ''rqt'' will list your EEROS application under the name ''eerosNode''. The variable ''node'' has to be passed to all blocks in the control system which publish or subscribe to ROS messages.\\+
  
 If you want to register a signal handler, e.g. for shutting down a system (see [[getting_started:practical_problems:abort|]]), you have to register it after the ROS node is initialized. If you want to register a signal handler, e.g. for shutting down a system (see [[getting_started:practical_problems:abort|]]), you have to register it after the ROS node is initialized.
 The ROS node will properly shut down as soon as the last node handler is destroyed when going out of scope. The ROS node will properly shut down as soon as the last node handler is destroyed when going out of scope.
 +
 +==== Building and Running ====
 +Before building you need to run the ''setup.bash'' script of ROS and the ''local_setup.bash'' which is located in the EEROS installation directory under ''share/eeros_msgs''
 +<code>
 +source /path_to_ros_installation/setup.bash
 +source /path_to_eeros_installation/share/eeros_msgs/local_setup.bash
 +</code>
 +
 +Make sure to run these scripts also before running the application.
 +
getting_started/ros_example.1733815047.txt.gz · Last modified: 2024/12/10 08:17 by ursgraf