How to read information from the Openni depth camera in Gazebo
Hello
I am using the Openni depth camera plugin in Gazebo. However; I faced some issues:
When I tried to see what's being published to the camera/depth/image_raw, I didn't know: - how to read the distance detected by the depth camera? - how to extract the images captured by the camera so I can use them for my robot learning?
Moreover; I opened RViz to see the image, it says that there is no image.
Can someone help me solve these issues?
Thanks a lot for your help.
Asked by user90 on 2018-06-29 03:47:21 UTC
Answers
how to read the distance detected by the depth camera
The depth image is encoded as "32FC1", meaning that each pixel is a one channel 32 bit floating point number representing the distance from the camera.
how to extract the images captured by the camera so I can use them for my robot learning?
This depends on what you want to do with the images. They are published as a ROS topic, so you can write a Subscriber to capture them into another program.
I opened RViz to see the image, it says that there is no image
Perhaps you are subscribed to the wrong topic, use rostopic list
to see what topics are available.
Asked by kev-the-dev on 2018-06-29 18:12:57 UTC
Comments
I understand your point of view concerning the distance between each pixel and the camera, however I am obtaining illogical numbers that represents the distance
Asked by user90 on 2018-07-09 09:41:58 UTC
The image is sent as ros image format. To get the real distance you can convert it to openCV first. http://wiki.ros.org/cv_bridge/Tutorials/ConvertingBetweenROSImagesAndOpenCVImagesPython
Asked by Zeckurbo on 2021-01-21 07:44:47 UTC
Comments