stereolabs / zed-ros-wrapper

ROS wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros/
MIT License
447 stars 391 forks source link

Output the data in numpy array #814

Closed kankanzheli closed 2 years ago

kankanzheli commented 2 years ago

Preliminary Checks

Proposal

Now I am try to use the zed camera with ros. When I am not working with the ros, we can use code from python to output the data from .svo files and save those data such as left data in to rgb image. And save the pointcloud in to a numpy array with shape(720,1280,4) By: def load_image_into_numpy_array(image): ar = image.get_data() ar = ar[:, :, 0:3] (im_height, im_width, channels) = image.get_data().shape return np.array(ar).reshape((im_height, im_width, 3)).astype(np.uint8) ..... zed.retrieve_measure(ptcloud, sl.MEASURE.XYZ, resolution=res) zed.retrieve_image(depth_img, sl.VIEW.DEPTH, resolution=res) ptcloud_np_global = np.array(ptcloud.get_data()) image_np_global = load_image_into_numpy_array(left)

So, when we using camera in ros how can we save the rgb data and pointcloud data in to the numpy array which is same as the numpy array from the above code?

Use-Case

No response

Anything else?

No response

Myzhar commented 2 years ago

Hi @kankanzheli this is nothing that can be added to the ROS wrapper. You must write your own ROS node that subscribes to point cloud and RGB image topics and converts the ROS data in numpy array data.