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

Can you structure the include folder in a ROS C++ Package with subfolders?

asked 2020-10-06 11:18:47 -0500

Paal gravatar image

I currently have some c++ libraries that i would like to implement and build in ROS using catkin workspaces. My method so far has been to let each library be its own package, but I've recently run into a problem of circular dependencies with the packages. My approach to fix this has been to implement the libraries within a single package, but i somehow wish to keep the libraries separated and i therefore wonder if it is possible to structure the include folder for a ROS c++ package with subfolders?

The idea would look something like this


--my_package
  --include
    --library_1
      someheaderfile.h
    --library_2
      someotherheaderfile.h
        ..
  --src
    --library_1
      somecppfile.cpp
    --library_2
      someothercppfile.cpp
  CMakelists.txt
  package.xml

I guess my main concern lies within breaking the catkin structure needed for proper compilation.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-10-06 13:03:24 -0500

gvdhoorn gravatar image

I guess my main concern lies within breaking the catkin structure needed for proper compilation.

there is no such structure.

Catkin ~= CMake.

is [it] possible to structure the include folder for a ROS c++ package with subfolders?

yes, of course.

There is no magic here. It's all just regular C++ and CMake.

As long as you make sure everything which needs to be on the include path ends up there things will just work.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-10-06 11:18:47 -0500

Seen: 510 times

Last updated: Oct 06 '20