ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The encoding you are using for the depth stream is wrong, you should use the unsigned 16 bit representation with a single channel, instead of the 3 channels of the RGB representation.
Modify the line -cv_depth = cv_bridge::toCvCopy(depth_image, enc::BGR8);
changing the encoding (check the correct definition for 16 unsigned char) -cv_depth = cv_bridge::toCvCopy(depth_image, enc::16UC1);
Then everything should be fine. Good luck, Tambo
2 | No.2 Revision |
The encoding you are using for the depth stream is wrong, you should use the unsigned 16 bit representation with a single channel, instead of the 3 channels of the RGB representation.
Modify the line -cv_depth = cv_bridge::toCvCopy(depth_image, enc::BGR8);
changing the encoding (check the correct definition for 16 unsigned char) -cv_depth = cv_bridge::toCvCopy(depth_image, enc::16UC1);
Then everything should be fine.
In this way, you can access depth data properly. According to the topic you subscribe to, you may obtain either representation in millimeters or in meters (both of them use floats)
Good luck, Tambo