param cloud_array: (6, num_points) return: PointCloud2 msg
(self,cloud_array,frame_id="camera_rgb_optical_frame")
| 307 | tf.close() |
| 308 | |
| 309 | def _cloud_arr2pc_msg(self,cloud_array,frame_id="camera_rgb_optical_frame"): |
| 310 | """ |
| 311 | param cloud_array: (6, num_points) |
| 312 | return: PointCloud2 msg |
| 313 | """ |
| 314 | new_arr = np.core.records.fromarrays(cloud_array, names=self.pointcloud_dtype.names) |
| 315 | new_arr = np.array(new_arr.astype(dtype=self.pointcloud_dtype).tolist(),dtype=self.pointcloud_dtype) |
| 316 | new_arr = ros_numpy.point_cloud2.merge_rgb_fields(new_arr) |
| 317 | new_cloud_msg = ros_numpy.point_cloud2.array_to_pointcloud2(new_arr,frame_id=frame_id) |
| 318 | return new_cloud_msg |
| 319 | |
| 320 | def _transform_cloud(self,transform_msg): |
| 321 | # Transform ('map' coordinates --> 'camera_rgb_optical_frame' coordinates) |