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

Revision history [back]

depth_image = self.bridge.imgmsg_to_cv2(depth_data, "32FC1")

change the code to

depth_image = self.bridge.imgmsg_to_cv2(depth_data, "passthrough")

then, you'll get depth_image as float32.

(no longer transform using np.array is not needed.)

click to hide/show revision 2
No.2 Revision

The line

depth_image = self.bridge.imgmsg_to_cv2(depth_data, "32FC1")

"32FC1")

change the code to

depth_image = self.bridge.imgmsg_to_cv2(depth_data, "passthrough")

"passthrough")

then, you'll get depth_image depth_image as float32.float32.

(no longer transform using np.array np.array is not needed.)