ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you subscribe to both /camera/rgb/image
and /camera/depth_registered/image
you should have to video streams (or maybe you want the image_rect topics). One is the standard RGB image, the other is the depth image that has been transformed into the same frame as the RGB image. A feature located at u,v in the RGB image should also exist at u,v in the depth image. From that information, you should know the u,v and the real-world Z distance. Then I'd recommend using the image_geometry to calculate X,Y. In Python you could use something like image_geometry.PinholeCameraModel.projectPixelTo3dRay
or image_geometry.PinholeCameraModel.getDeltaX
(and getDeltaY). If you are in C++ you could use the corresponding functions.