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

Revision history [back]

click to hide/show revision 1
initial version

Your CMakeLists.txt shows:

project(explore_lite)

[..]

add_message_files(
  FILES
  util.msg
)

The error output shows:

/home/erinline/Documents/testsim/src/m-explore/explore/src/explore.cpp:39:10: fatal error: msg/util.h: No such file or directory
#include <msg/util.h>

You write:

My message is called util.msg, it is in a file called msg within the package file called explore [..]

There are a few discrepancies here:

  • according to your build script, the package is actually called explore_lite, not explore
  • the compiler output suggests it's in a directory called m-explore (or the package is actually called m-explore)

As to why the include fails: message header #include lines follow the pattern: pkg_that_hosts_the_msg/MsgHeader.h.

In your care this should probably be explore_lite/util.h, not msg/util.h.

Two additional comments:

  1. it might be good to store messages in a separate package (it will make interfacing with your package much easier, as I don't have to build your node in order to use the messages)
  2. try to follow ROS naming guidelines: util as a name does not convey much semantics and message (file)names should start with an uppercase character

Your CMakeLists.txt shows:

project(explore_lite)

[..]

add_message_files(
  FILES
  util.msg
)

The error output shows:

/home/erinline/Documents/testsim/src/m-explore/explore/src/explore.cpp:39:10: fatal error: msg/util.h: No such file or directory
 #include <msg/util.h>

You write:

My message is called util.msg, it is in a file called msg within the package file called explore [..]

There are a few discrepancies here:

  • according to your build script, the package is actually called explore_lite, not explore
  • the compiler output suggests it's in a directory called m-explore (or the package is actually called m-explore)

As to why the include fails: message header #include lines follow the pattern: pkg_that_hosts_the_msg/MsgHeader.h.

In your care this should probably be explore_lite/util.h, not msg/util.h.

Two additional comments:

  1. it might be good to store messages in a separate package (it will make interfacing with your package much easier, as I don't have to build your node in order to use the messages)
  2. try to follow ROS naming guidelines: util as a name does not convey much semantics and message (file)names should start with an uppercase character