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

You need to tell your compiler where the include files are, since they are not in a "standard" location. How you actually do this will depend on how you're managing your build (with cmake, make, or just running g++).

You need to tell your compiler where the include files are, since they are not in a "standard" location. How you actually do this will depend on how you're managing your build (with cmake, make, or just running g++).

Edit: You're setting the include directory to be

/opt/ros/fuerte/stacks/navigation/costmap_2d

and in the code you're (presumably) doing

#include <costmap_2d/costmap_2d_ros.h>

which means that the compiler will be looking for the file

/opt/ros/fuerte/stacks/navigation/costmap_2d/costmap_2d/costmap_2d_ros.h

when what you want is

/opt/ros/fuerte/stacks/navigation/costmap_2d/include/costmap_2d/costmap_2d_ros.h

The correct include directory is probably

/opt/ros/fuerte/stacks/navigation/costmap_2d/include

Of course, the include file you're using will include it's own files, and you'll have to have the directories for these listed in the CMakelists.txt file, too. ROS manages all of this behind the scenes when you build a package. If you're doing it on your own, you'll have to do it by hand (which might be a tedious process).

Have you considered building your code with the ROS build tools, even though it's not ROS code? Might be easier if there are a lot of recursive dependencies.

You need to tell your compiler where the include files are, since they are not in a "standard" location. How you actually do this will depend on how you're managing your build (with cmake, make, or just running g++).

Edit: You're setting the include directory to be

/opt/ros/fuerte/stacks/navigation/costmap_2d

and in the code you're (presumably) doing

#include <costmap_2d/costmap_2d_ros.h>

which means that the compiler will be looking for the file

/opt/ros/fuerte/stacks/navigation/costmap_2d/costmap_2d/costmap_2d_ros.h

when what you want is

/opt/ros/fuerte/stacks/navigation/costmap_2d/include/costmap_2d/costmap_2d_ros.h

The correct include directory is probably

/opt/ros/fuerte/stacks/navigation/costmap_2d/include

Of course, the include file you're using will include it's own files, and you'll have to have the directories for these listed in the CMakelists.txt file, too. ROS manages all of this behind the scenes when you build a package. If you're doing it on your own, you'll have to do it by hand (which might be a tedious process).

Have you considered building your code with the ROS build tools, even though it's not ROS code? Might be easier if there are a lot of recursive dependencies.

Edit 2:

If you're using rosmake (or catkin) to build things, then you should also be updating your manifest.xml (or catkin equivalent) in parallel. This will resolve all of the locations for you automatically. I assumed (perhaps wrongly) in the initial answer that you were just invoking cmake and make yourself.