Ask Your Question

Revision history [back]

You definitely should have your messages in the msg folder. I would say you are missing two things:

  • In catkin_package you should add EXPORTED_TARGETS mobility_generate_messages_cpp
  • Add this dependency to your executable: add_dependencies(mobility mobility_generate_messages_cpp)

This way, you are saying that mobility requires the messages generated and thus catkin would build them first. If you do not have these lines, it can compile if, for some reason, catkin decides to build first the messages instead of the executable. But if dependencies are not properly set then this is not guaranteed, and I would say this is what is happening to you.