[ros-users] pointcloud to pointcloud2 conversion

Tully Foote tfoote at willowgarage.com
Tue Oct 19 00:13:22 UTC 2010


Hi,

The method to do that conversion is available in the sensor_msgs package.
Documented at
http://www.ros.org/doc/api/sensor_msgs/html/namespacesensor__msgs.html#ab3bdbe5a82173d3483899c776e6ccbab

Tully

On Mon, Oct 18, 2010 at 5:07 PM, Martin, L <kollaps2001 at hotmail.com> wrote:

>
> Hi,
>
> I am sure it is probably a silly question to ask... but I can't get
> pointcloud to pointcloud2 conversion to work.
>
> To this is basically what I want to do:
>
>
>  void scanCallback (const sensor_msgs::PointCloudConstPtr &cloud)
>  {
>          sensor_msgs::PointCloud2 cloud2;
>          pcl::toROSMsg(*cloud, cloud2);
>
>           pcl::io::savePCDFile("test.pcd", cloud2, false);
>  }
>
>
> in words, I simply want to write the incoming pointcloud to a file. However
> as (to my understanding) the pointcloud needs to be in the pointcloud2
> format, did I try to convert it. Which however fails:
>
>
> error: no matching function for call to ‘toROSMsg(const
> sensor_msgs::PointCloud_<std::allocator<void> >&,
> sensor_msgs::PointCloud2&)’
>
>
> I have tried many things... but can't get it to work... so since I believe
> it is only a small issue did I figure I just ask .
>
> Or is there maybe a different way of saving it to a file?
>
> Many thanks in advance!
>
> --
> View this message in context:
> http://ros-users.122217.n3.nabble.com/pointcloud-to-pointcloud2-conversion-tp1729261p1729261.html
> Sent from the ROS-Users mailing list archive at Nabble.com.
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



-- 
Tully Foote
Systems Engineer
Willow Garage, Inc.
tfoote at willowgarage.com
(650) 475-2827
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101018/bc9b58f7/attachment-0003.html>


More information about the ros-users mailing list