Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

ros pointcloud2 read_points c++

#include <sensor_msgs/PointCloud.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/point_cloud_conversion.h>

sensor_msgs::Pointcloud2 input_pointcloud;
sensor_msgs::Pointcloud out_pointcloud;
sensor_msgs::convertPointCloud2ToPointCloud(input_pointcloud, out_cloud);

for(int i = 0 ; i < out_cloud.points.size(); ++i){
    geometry_msgs::Point32 point;

    //Dooo something here
    point.z = out_cloud.points[i].z;
}
Source by answers.ros.org #
 
PREVIOUS NEXT
Tagged: #ros
ADD COMMENT
Topic
Name
7+5 =