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

Problems finding messages when compiling ROS project

asked 2020-07-17 04:00:12 -0600

lavnir gravatar image

updated 2022-01-22 16:16:17 -0600

Evgeny gravatar image

Hi, I've been having some problems lately with ROS and catkin_make. Whenever I compile the whole project cmake struggles to find certain messages. I would paste the errors codes but they are just like "package/msg.h not found". The weird thing is that after trying to compile the project 3 or 4 times for some reason the compiler is able to end up finding everything and the whole thing works.

I would like to solve this issue, whoever after spending some days studying cmake and package files I could not find the source of the problem, does anyone know how could I track down this bug? I've been able to isolate this problem to one package, and the only different thing from the rest is that I compiled it with the c++11 flag.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-07-17 04:47:58 -0600

ipa-jba gravatar image

Hi,

since your information provided is quite sparse I'm not certain in the answer. However I'm assuming your messages are defined in the same package as your node. Have you checked that your include directiories are set

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

and your dependencies are set to include ${${PROJECT_NAME}_EXPORTED_TARGETS} to make sure your messages are built before your node/library...

add_dependencies(my_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
edit flag offensive delete link more

Comments

Thanks! That was it, just missed to add the dependencies so that msgs are built before the rest.

lavnir gravatar image lavnir  ( 2020-07-18 11:30:41 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-17 04:00:12 -0600

Seen: 409 times

Last updated: Jul 17 '20