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

How to include headers from other packages

asked 2013-12-12 03:32:26 -0500

eds gravatar image

updated 2013-12-12 19:58:26 -0500

tfoote gravatar image

I'm using ROS Groovy with catkin.

I created a package1 with a file1.cpp in the src directory and a header file1.h in its include/package directory.

I need to #include this header in another file2.cpp of another package2 in the same workspace and then call those declared function.

file1.cpp doesn't have any main() function. It's only a list of functions and their body definitions.

I'm not secure with this tool because everything I tried using tutorials is not working. Please, give me full informations about what to write in every CMakeLists.txt or package.xml and how to include that header in both packages.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-12-15 21:12:05 -0500

pkohout gravatar image

You have to say in the manifest of package2 that it need package1 to run, if I remember right I is a dependencie. After you have rebuild It then, you should be able to include it something like "packageName/HeaderName"

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-12-12 03:32:26 -0500

Seen: 1,215 times

Last updated: Dec 15 '13