0

I am a beginner with ROS2 and C++ and I can use some help understanding how the architecture of ROS 2 works. I want to implement a QoS-event into a simple chatter program and with my basic knowledge I can make following graph:

CODE (publisher.cpp) ==> RCLCPP(qos_event.cpp) this includes (qos_event.hpp) ==> RCL (event.c) this includes (event.h) ==> RMW (event.c) this includes (event.h) ==> DDS

I have the following questions:

  1. If I understand it right, header files are used as some kind of library. So if you include them in your program you can use all the functions you want. This means I don't need to use this code in my program but I only need to implement those functions? Are the following files: qos_event.cpp / rcl event.c / rmw event.c examples of code that I can use into my own program?

  2. The Quality of Service (QoS) settings are declared in the Ros middleware (rmw). If I want to use one of those events, can I just directly use the rmw/event.h header file or do I need to respect the architecture and is it only possible to implement rclcpp code in your program?

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
jlepers
  • 11
  • 2

1 Answers1

0

1) Generally header files have declarations of functions that you can use and .c or .cpp files have the definition of them, showing how the function actually is implemented. This may be a good starting point for that. In order to use this functions in your executable or library, you have to add these dependencies via CMakeLists.txt and package.xml(a whole new world for c++ beginners).

2) About this ... I would recommend checking this git from ROS2 and studying how these functions were used.

Usually people say to study c++ before using the ROS Framework, this is a really good advice.

ignacio
  • 1,181
  • 2
  • 15
  • 28