What would be the best way to visulaize the lidar point cloud data. I am using cv_bridge for image data.
def __init__(self):
self.bridge = CvBridge()
self.depth_sub = message_filters.Subscriber("/os1_cloud_node/points", PointCloud2)
self.image_sub = message_filters.Subscriber("/pylon_camera_node/image_rect_color", Image)
ts = message_filters.ApproximateTimeSynchronizer([self.image_sub, self.depth_sub], 10, 1)
ts.registerCallback(self.callback)
def callback(self, color, depth):
pass # TODO
Edit [from comment below]:
Sorry I have used rviz to visualize the topic itself. Is there a way to extract points and diplay using opencv, pcl etc.
pc = ros_numpy.numpify(depth)
height = pc.shape[0]
width = pc.shape[1]
np_points = np.zeros((height * width, 3), dtype=np.float32)
np_points[:, 0] = np.resize(pc['x'], height * width)
np_points[:, 1] = np.resize(pc['y'], height * width)
np_points[:, 2] = np.resize(pc['z'], height * width)