title: Extract Point Cloud from a pcl::people::PersonCluster<PointT>
body: <p>I am doing a project for the university and I need to extract the point cloud of the people to work with it. I made an ROS node adapting the code of the tutorial <a href="http://pointclouds.org/documentation/tutorials/ground_based_rgbd_people_detection.php" rel="nofollow">Ground based rgdb people detection</a>, and now I want to publish in a topic the point cloud of the first detected cluster.</p>
  
  <p>But I am not able to extract that point cloud, the definition of the class is defined here <a href="http://docs.pointclouds.org/trunk/person__cluster_8h_source.html" rel="nofollow">person_cluster.h</a>. And there is a public member: </p>
  
  <pre><code>typedef pcl::PointCloud&lt;PointT&gt; PointCloud;
  </code></pre>
  
  <p>So to convert it in a <code>sensor_msgs::PointCloud2</code> I do:</p>
  
  <pre><code>pcl_conversions::fromPCL(clusters.at(0).PointCloud,person_msg);
  </code></pre>
  
  <p>where <code>person_msg</code> is the <code>PointCLoud2</code> message, <code>clusters</code> is a vector of <code>pcl::people::PersonCluster&lt;PointT&gt;</code>, and I want to publish only the first point cloud because I assume that there is only one person in the scene.</p>
  
  <p>The compiler gives me this error:</p>
  
  <blockquote>
    <p>error: <strong>invalid use of</strong> ‘pcl::people::PersonCluster::PointCloud’
         pcl_conversions::fromPCL(clusters.at(0).PointCloud,person_msg);</p>
  </blockquote>
  
  <p>I don't have a lot of knowledge about C++ and I am not able to overcome this error. Googling that error it seems that it appears when you don't "define" well a class, but I doubt that in the pcl library they defined bad a class. </p>