Dear Zhiping, Thank you for your interest in PCL. The tutorial you were trying to compile on the wiki is unfortunately not in sync with the latest changes in the PCL API, and I forgot to update it. The code there requires an one-line change to compile, namely: 25 point_cloud::fromMsg (*cloud_blob, cloud); should be 25 pcl::fromROSMsg (*cloud_blob, cloud); I just updated the web page so if you check it again you should see the updated code. Also please note that all the tutorials on the wiki are already present in the pcl_tutorials package, so you don't have to copy&paste them into separate files to try them out. Cheers, Radu. On 09/08/2010 12:40 PM, #TAN ZHI PING# wrote: > Hi all, > > I try to run bag_read.cpp from this website: > > http://www.ros.org/wiki/pcl/Tutorials/Reading%20Point%20Cloud%20data%20from%20BAG%20files > > But when i compile. these are the error messages produced: > ---------------------------------------------------------------------------------------------------------------------Debug---------------------------------------------------------------------------------------------------- > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp: > In function ‘int main(int, char**)’: > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:10: > error: ‘sensor_msgs’ has not been declared > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:10: > error: expected ‘;’ before ‘cloud_blob’ > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:11: > error: ‘PointCloud’ is not a member of ‘pcl’ > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:11: > error: expected primary-expression before ‘>’ token > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:11: > error: ‘cloud’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:13: > error: ‘pcl_ros’ has not been declared > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:13: > error: expected ‘;’ before ‘reader’ > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:14: > error: ‘reader’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:16: > error: ‘ROS_ERROR’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:23: > error: ‘cloud_blob_prev’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:23: > error: ‘cloud_blob’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:24: > error: ‘reader’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:27: > error: ‘point_cloud’ has not been declared > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:28: > error: ‘ROS_INFO’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:32: > error: ‘cloud_blob’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:32: > error: ‘cloud_blob_prev’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:34: > error: ‘ROS_INFO’ was not declared in this scope > ---------------------------------------------------------------------------------------------------------------------End > Debug---------------------------------------------------------------------------------------------------- > i tried to solve these problems by adding more headers to the file namely > > #include "pcl_ros/io/bag_io.h" > #include "pcl/point_types.h" > #include "pcl/point_cloud.h" //<--Just Added > #include "sensor_msgs/point_cloud_conversion.h" //<--Just Added > > ---------------------------------------------------------------------------------------------------------------------Debug---------------------------------------------------------------------------------------------------- > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp: > In function ‘int main(int, char**)’: > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:13: > error: ‘pcl_ros’ has not been declared > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:13: > error: expected ‘;’ before ‘reader’ > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:14: > error: ‘reader’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:24: > error: ‘reader’ was not declared in this scope > /home/snoopy/robot/ros-pkg/stacks/point_cloud_perception/trunk/pcl/src/examples/bag_read.cpp:27: > error: ‘point_cloud’ has not been declared > ---------------------------------------------------------------------------------------------------------------------End > Debug---------------------------------------------------------------------------------------------------- > > How do i solve the remaining problems ? > > With thanks, > Zhiping > > > > > > > _______________________________________________ > ros-users mailing list > ros-users@code.ros.org > https://code.ros.org/mailman/listinfo/ros-users -- | Radu Bogdan Rusu | http://rbrusu.com/