ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROSCpp - Using common Header files

asked 2018-05-17 04:50:33 -0500

Gil404 gravatar image

Hi Guys,

I have a multiple package project in which I need to use the same headers (classes). How can I do it? What is the right way to go? Should I create a new package / folder with all the needed headers? if so, how do I need them to the makefiles in the different packages?

Thank you very much

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-17 07:53:57 -0500

gvdhoorn gravatar image

Should I create a new package / folder with all the needed headers?

If the headers contain ROS-related types, methods, classes, functions, etc, then: yes. That would be a good way to make them available to other ROS packages.

If they are not ROS-related, then treat them like any other system dependency and create a non-ROS, regular C/C++ project.

if so, how do I need them to the makefiles in the different packages?

Please see the Catkin documentation for this, and please search ROS Answers (use Google: site:answers.ros.org <your search terms>.

This has been asked and answered too many times already to answer again.

Note: Catkin is just about equivalent to CMake, so large parts of this will be CMake, not Catkin.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-05-17 04:50:33 -0500

Seen: 210 times

Last updated: May 17 '18