ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 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

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