Ask Your Question
0

pcl_visualization cannot detect .h file

asked 2011-06-28 12:11:19 -0500

surfexceltide gravatar image

updated 2011-06-29 15:23:44 -0500

dornhege gravatar image

hello all,

I am trying to visualize point cloud information, using the pcl_visualization package from perception_pcl_addons. following is ithe relevant part of the code i am using:

#include <pcl_visualization slash cloud_viewer.h>

void depth_cb(const sensor_msgs::PointCloud2 &cloud2_msg)
{

    std::string filename="test_pcd.pcd";

    pcl::PointCloud<pcl::PointXYZ> cloud_t_msg;

    pcl::fromROSMsg(cloud2_msg,cloud_t_msg);

    pcl::io::savePCDFileASCII(filename,cloud_t_msg);

    pcl_visualization::CloudViewer viewer("Simple Cloud Viewer");

    viewer.showCloud(cloud);

    while (!viewer.wasStopped())
    {
    }

}

(there's a long list of attached files that i'm not mentioning)

here's the error i get - it cannot find cloud_viewer.h eventhough i have confirmed it exists at the proper location in my filesystem.

/home/samarth/kinect_listener/src/listener.cpp:20:44: error: pcl_visualization/cloud_viewer.h: No such file or directory

/home/samarth/kinect_listener/src/listener.cpp: In function ‘void depth_cb(const sensor_msgs::PointCloud2&)’:

/home/samarth/kinect_listener/src/listener.cpp:69: error: ‘pcl_visualization’ has not been declared

/home/samarth/kinect_listener/src/listener.cpp:69: error: expected ‘;’ before ‘viewer’

/home/samarth/kinect_listener/src/listener.cpp:70: error: ‘viewer’ was not declared in this scope

make[3]: *** [CMakeFiles/listener.dir/src/listener.o] Error 1

make[3]: Leaving directory `/home/samarth/kinect_listener/build'

make[2]: *** [CMakeFiles/listener.dir/all] Error 2

make[2]: Leaving directory `/home/samarth/kinect_listener/build'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/home/samarth/kinect_listener/build'

make: *** [all] Error 2

PS - my ROS_PACKAGE_PATH variable is suitably set. so no problem there.

edit retag flag offensive close merge delete

Comments

i dunno how the include line got edited by itself, but its #include <pcl_visualization/cloud_viewer.h>
surfexceltide gravatar image surfexceltide  ( 2011-06-28 12:22:33 -0500 )edit
You can make code appear as code by indenting it using 4 spaces.
dornhege gravatar image dornhege  ( 2011-06-29 15:31:07 -0500 )edit
ok, will do that in future, thanks!
surfexceltide gravatar image surfexceltide  ( 2011-06-29 16:01:23 -0500 )edit
you can use the edit button to fix your posts, and update them with more information too.
tfoote gravatar image tfoote  ( 2011-06-29 16:13:45 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2011-06-29 13:05:32 -0500

vincent gravatar image

did you add perception_pcl_addons to the package dependency?

edit flag offensive delete link more

Comments

ok, gotcha! that did the trick! :)
surfexceltide gravatar image surfexceltide  ( 2011-06-29 16:38:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-06-28 12:11:19 -0500

Seen: 1,044 times

Last updated: Jun 29 '11