Unable to find header files when compiing
I am writing a node, and I am trying to use the ROS and tf tutorials to help me. When I try to compile the .cpp file, the files that I have included, such as
#include <ros/ros.h>
#include <ros/package.h>
cannot be found. Am I supposed to include these under different names?
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()
#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
rosbuild_add_executable(SkeletonTracker src/SkeletonTracker.cpp)
This is my manifest.xml:
<package>
<description brief="skeletonTracker">
skeletonTracker
</description>
<author>robot</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/skeletonTracker</url>
<depend package="std_msgs"/>
<depend package="rospy"/>
<depend package="roscpp"/>
</package>
If I try to use rosmake to build the package, this is output:
robot@neutronstar:~/SkeletonTracking/skeletonTracker$ rosmake
[ rosmake ] No package specified. Building ['skeletonTracker']
[ rosmake ] Packages requested are: ['skeletonTracker']
[ rosmake ] Logging to directory/home/robot/.ros/rosmake/rosmake_output-20110713-134607
[ rosmake ] Expanded args ['skeletonTracker'] to:
['skeletonTracker']
[ rosmake ] Checking rosdeps compliance for packages skeletonTracker. This may take a few seconds.
[ rosmake ] rosdep check passed all system dependencies in packages
[rosmake-0] Starting >>> roslib [ make ]
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib
[rosmake-1] Starting >>> rosgraph_msgs [ make ]
[rosmake-1] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
[rosmake-2] Starting >>> rosbuild [ make ]
[rosmake-2] Finished <<< rosbuild ROS_NOBUILD in package rosbuild
No Makefile in package rosbuild
[rosmake-3] Starting >>> cpp_common [ make ]
[rosmake-0] Starting >>> std_msgs [ make ]
[rosmake-1] Starting >>> roslang [ make ]
[rosmake-3] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
[rosmake-0] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
[rosmake-1] Finished <<< roslang ROS_NOBUILD in package roslang
No Makefile in package roslang
[rosmake-2] Starting >>> xmlrpcpp [ make ]
[rosmake-0] Starting >>> roscpp_traits [ make ]
[rosmake-1] Starting >>> rostime [ make ]
[rosmake-2] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp
[rosmake-3] Starting >>> rospy [ make ]
[rosmake-1] Finished <<< rostime ROS_NOBUILD in package rostime
[rosmake-3] Finished <<< rospy ROS_NOBUILD in package rospy
[rosmake-0] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
[rosmake-1] Starting >>> roscpp_serialization [ make ]
[rosmake-3] Starting >>> rosconsole [ make ]
[rosmake-3] Finished <<< rosconsole ROS_NOBUILD in package rosconsole
[rosmake-1] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization
[rosmake-1] Starting >>> roscpp [ make ]
[rosmake-1] Finished <<< roscpp ROS_NOBUILD in package roscpp
[rosmake-1] Starting >>> skeletonTracker [ make ]
[ rosmake ] Last 40 lineseletonTracker: 2.8 sec ] [ 1 Active 14/15 Complete ]
{-------------------------------------------------------------------------------
make[3]: Leaving directory `/home/robot/SkeletonTracking/skeletonTracker/build'
[ 0%] Built target rospack_genmsg_libexe
make[3]: Entering directory `/home/robot/SkeletonTracking/skeletonTracker/build'
make[3]: Leaving directory `/home/robot/SkeletonTracking/skeletonTracker ...