Creating ROS nodes and classes with RoboWare tools

RoboWare Studio provides a wizard procedure to create C++ and Python classes and ROS nodes. To create a ROS node, do the following:

  1. Right-click on the package name and select either Add C++ ROS Node or Add Python ROS Node.
  2. Type the name of the package.
  3. By default, two source files will be created: an example of a publisher and a subscriber node. For example, if you inserted chatter as a package name, a chatter_pub.cpp file and a chatter_sub.cpp file will be created.
  4. Compile the package. The CMakeLists.txt file has already been updated according to the newly created nodes. You can remove the publisher or the subscriber in case you don't need them; the CMakeLists.txt file will be automatically updated.

As well as ROS nodes, we can create C++ classes using the following method:

  1. Right-click on the package name
  2. Choose Add C++ Class
  3. Type the name of the class—for example, roboware_class
  4. A header file will be created in the include directory of the package named roboware_class.h, while a CPP file named roboware_class.cpp will be added to the src directory
  5. Select an executable to link the class just created, in order to import the class into another ROS node of the package
  6. The CMakeLists.txt will be updated automatically
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.138.232