I was working on a project and stumbled upon an issue with the indexing in three dimensions.
How do I index into the z value of a point?
PCL most commonly stores its point cloud information in an un-ordered form. The point itself carries the information you might need.
For example the type PointXYZ
has the following structure:
pcl::PointXYZ::PointXYZ (
float _x,
float _y,
float _z
)
Find out more about the point types here.
So in order to get the z information, you would do the following:
cloud->points[i]._z; // Depth information from a point in your point cloud.