Ask Your Question
0

Catkinising package- Unable to include a header file from another package- Indigo

asked 2017-10-09 12:47:00 -0500

Amogh Gupta gravatar image

updated 2017-10-09 14:20:51 -0500

I have three packages in the same workspace called:

art_msgs (contains messages in art_msgs/msg folder)

art_common (contains some nodes in art_common/srcfolder which depend on messages from art_msgs; and art_common/include/art folder)

art_map (contains nodes in art_map/src which depend on art_common)

I am able to successfully compile art_msgs and art_common. However the nodes of art_map include header files from art_common/include/art which are not included when I catkin_build the workspace.

Based on another post, I have tried installing the header file, by adding the following in CMakeLists.txt of art_common

install(DIRECTORY include/art/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE)

which results in the following error:

In file included from /home/amogh/rosws2/src/art_map/src/DrawLanes.cc:2:0:
/home/amogh/rosws2/src/art_map/include/art_map/euclidean_distance.h:20:25: fatal error: art/epsilon.h: No such file or directory
 #include <art/epsilon.h>

Also when I add the following, in CMakeLists.txt of art_map:

find_package(catkin REQUIRED COMPONENTS art_common)

The following error arises:

Errors     << art_map:check /home/amogh/rosws2/logs/art_map/build.check.044.log                          
CMake Error at /home/amogh/rosws2/devel/share/art_common/cmake/art_commonConfig.cmake:165 (find_package):
  By not providing "Findart_msgs.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "art_msgs",
  but CMake did not find one.

  Could not find a package configuration file provided by "art_msgs" with any
  of the following names:

    art_msgsConfig.cmake
    art_msgs-config.cmake

Other required dependencies have been resolved in package.xml and CMakeLists.txt. You can see the complete code here.

edit retag flag offensive close merge delete

Comments

Btw: may I suggest a title change? The problem here is that the catkinisation of your pkgs is incomplete/incorrect. Whether or not the headers can be included successfully remains to be seen.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-09 14:04:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-09 12:51:45 -0500

gvdhoorn gravatar image

If I'm not mistaken, the packages you are referring to were rosbuild packages.

You converted them to Catkin, but if I look at art_msgs/src/art_msgs/CMakeLists.txt, I don't see a catkin_package(..) statement anywhere.

That will cause the error you included in your OP.

If you haven't already, please check the catkin/migrating_from_rosbuild page on the wiki. And check the catkin documentation on how to deal with things like message and service dependencies.

edit flag offensive delete link more

Comments

Yes, I am attempting to catkinise rosbuild packages, I added the following based on your suggestion:

catkin_package(
    DEPENDS
    CATKIN_DEPENDS message_generation nav_msgs geometry_msgs std_msgs sensor_msgs
    INCLUDE_DIRS
    LIBRARIES
)

Still the same errors.

Amogh Gupta gravatar image Amogh Gupta  ( 2017-10-09 13:16:38 -0500 )edit

Order matters for these things. Please remove your build and devel directories, read the pages I linked to carefully, read wiki/catkin/CMakeLists.txt also carefully and try again.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-09 14:02:57 -0500 )edit
catkin_package(
    DEPENDS
    CATKIN_DEPENDS message_generation 
    ..

That won't work, and is also described in the pages I linked to: the CATKIN_DEPENDS should be message_runtime.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-09 14:05:53 -0500 )edit

I made the change suggested and went through the links in my understanding, however still unable to build the package, it is unable to find the header files from art_common/include/art.

Amogh Gupta gravatar image Amogh Gupta  ( 2017-10-10 08:29:00 -0500 )edit

It would help if you could push your current state to your github repository.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-10 09:31:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-10-09 12:47:00 -0500

Seen: 509 times

Last updated: Oct 09 '17