Hi,<br><br>The method to do that conversion is available in the sensor_msgs package.  Documented at  <a href="http://www.ros.org/doc/api/sensor_msgs/html/namespacesensor__msgs.html#ab3bdbe5a82173d3483899c776e6ccbab">http://www.ros.org/doc/api/sensor_msgs/html/namespacesensor__msgs.html#ab3bdbe5a82173d3483899c776e6ccbab</a><br>

<br>Tully<br><br><div class="gmail_quote">On Mon, Oct 18, 2010 at 5:07 PM, Martin, L <span dir="ltr"><<a href="mailto:kollaps2001@hotmail.com">kollaps2001@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

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


Sent from the ROS-Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>(650) 475-2827<br>