pointcloud demo

This commit is contained in:
ZhangWanjie 2019-07-26 11:48:23 +08:00
parent f6ec90651d
commit 32cd8f1817

View File

@ -45,12 +45,14 @@ void callbackPC(const sensor_msgs::PointCloud2ConstPtr& msg)
pcl::fromROSMsg(*msg , pointCloudIn); pcl::fromROSMsg(*msg , pointCloudIn);
int cloudSize = pointCloudIn.points.size(); int cloudSize = pointCloudIn.points.size();
int pcIndex = cloudSize/2; for(int i=0;i<cloudSize;i++)
ROS_INFO("[pcIndex= %d] ( %.2f , %.2f , %.2f)", {
pcIndex , ROS_INFO("[i= %d] ( %.2f , %.2f , %.2f)",
pointCloudIn.points[pcIndex].x, i ,
pointCloudIn.points[pcIndex].y, pointCloudIn.points[i].x,
pointCloudIn.points[pcIndex].z); pointCloudIn.points[i].y,
pointCloudIn.points[i].z);
}
} }
int main(int argc, char **argv) int main(int argc, char **argv)