Pergunta

i had installed ROS and PCL in ubuntu... The import in my code are:

#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/correspondence.h>
#include <pcl/features/normal_3d_omp.h>
#include <pcl/features/shot_omp.h>
#include <pcl/features/board.h>
#include <pcl/keypoints/uniform_sampling.h>
#include <pcl/recognition/cg/hough_3d.h>
#include <pcl/recognition/cg/geometric_consistency.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/kdtree/impl/kdtree_flann.hpp>
#include <pcl/common/transforms.h>
#include <pcl/console/parse.h>

When i compile the program with this CMakeLists:

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(correspondence_grouping)
find_package(PCL 1.3 REQUIRED COMPONENTS common io)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(correspondence_grouping correspondence_grouping.cpp)
target_link_libraries(correspondence_grouping ${PCL_COMMON_LIBRARIES}${PCL_IO_LIBRARIES})

appears this error:

In file included from /opt/ros/fuerte/include/pcl-1.5/pcl/io/pcd_io.h:43:0,
             from /home/user/Desktop/PCL/Grouping/correspondence_grouping.cpp:1:
/opt/ros/fuerte/include/pcl-1.5/pcl/point_cloud.h:46:29: fatal error: std_msgs/Header.h: No such file or directory

I'm new in Linux and ROS+PCL (i'm using them for an university project..) and i can't understand which is the problem.

P.S. Similary error appear with other cpp files with PCL.

I don't know how to do to fix it...

Thanks

Foi útil?

Solução

I think you will be better off using the ROS build system, which is either rosbuild or catkin depending on the version of ROS you are using. catkin is AFAIK a set of CMake macros that pull in ROS dependencies etc.

See:

http://wiki.ros.org/pcl/Tutorials

Outras dicas

You should use the rosbuild environment to create a package (See: [Creating a ros package]) and then put this into your CMakelist.txt to use PCL:

 ...
 find_package(PCL 1.3 REQUIRED)
 include_directories(${PCL_INCLUDE_DIRS})
 link_directories(${PCL_LIBRARY_DIRS})
 add_definitions(${PCL_DEFINITIONS})
 ...

The dependencie to std_msgs is handled by the manifest.xml (automatically generate with the package) with the following standard dependecies:

<package>
...
    <depend package="std_msgs"/>
    <depend package="rospy"/>
    <depend package="roscpp"/>
...
</package>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top