ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
After looking into the source code I found out that this read_points is a generator function that yields the next value of a cloud each time it is called. It works also as an iterator and calling it in a loop will deliver all pointcloud points: for p in enumerate(point_cloud2.read_points(pc2, field_names = ("x", "y", "z"), skip_nans=True)): cloud_points.append(p)
2 | No.2 Revision |
After looking into the source code I found out that this read_points is a generator function that yields the next value of a cloud each time it is called. It works also as an iterator and calling it in a loop will deliver all pointcloud points:
cloud_points = []
for p in enumerate(point_cloud2.read_points(pc2, field_names = ("x", "y", "z"), skip_nans=True)):
cloud_points.append(p) cloud_points.append(p)
cloud_points will then be a list of 3D points forming the cloud.
3 | No.3 Revision |
After looking into the source code I found out that this read_points is a generator function that yields the next value of a cloud each time it is called. It works also as an iterator and calling it in a loop will deliver all pointcloud points:
points:
cloud_points = []
for p in enumerate(point_cloud2.read_points(pc2, field_names = ("x", "y", "z"), skip_nans=True)):
cloud_points.append(p)
cloud_points.append(p)
cloud_points will then be a list of 3D points forming the cloud. 4 | No.4 Revision |
After looking into the source code I found out that this read_points is a generator function that yields the next value of a cloud each time it is called. It works also as an iterator and calling it in a loop will deliver all pointcloud points:
cloud_points = []
for p in enumerate(point_cloud2.read_points(pc2, field_names = ("x", "y", "z"), skip_nans=True)):
cloud_points.append(p)
Here pc2 is my pointcloud of type sensor_msgs/PointCloud2
and cloud_points will then be a list of 3D points forming the cloud.
5 | No.5 Revision |
After looking into the source code I found out that this read_points is a generator function that yields the next value of a cloud each time it is called. It works also as an iterator and calling it in a loop will deliver all pointcloud points:
cloud_points = []
for p in enumerate(point_cloud2.read_points(pc2, point_cloud2.read_points(pc2, field_names = ("x", "y", "z"), skip_nans=True)):
skip_nans=True):
cloud_points.append(p)
Here pc2 is my pointcloud of type sensor_msgs/PointCloud2
and cloud_points will then be a list of 3D points forming the cloud.