Project

General

Profile

Actions

Bug #434

closed

Encoding format for depth channel

Added by Barbara Bazzana 23 days ago. Updated 22 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-

Description

I would like to emulate the publishing of /camera/aligned_depth_to_color/image_raw, as done by realsense2_camera SDK.

I am now streaming the depth on ROS as follows:
::realsense::stream_depth {type ::realsense::STREAM_DEPTH index -1 width 848 height 480 format ::or::sensor::pixmap::ANY fps 0 name depth}
::realsense::publish {slot depth bank depth index 0}
A ROS node subscribes to the resulting topic and translates the openrobots message into sensor_msgs::Image.
However, I need to specify the encoding (which was 16UC1 originally). If I try to specify it like this, I cannot visualize the topic on RViz. Could you help me? What encoding should I pick?

Actions #1

Updated by Anthony Mallet 23 days ago

  • Status changed from New to Feedback

I added a bit more documation regarding the formats of
stream_depth() (9da74d78).

By default (format `ANY`) it's Z32, so an image of 32 bits floats
containing the depth information.

I think this should correspond to CV_32FC1 in OpenCV. I'm not sure
what rviz uses, though.

Does this help?

Actions #2

Updated by Barbara Bazzana 22 days ago

Thanks Anthony!

I was able to visualize in RViz by sending in the encoding: Z32;
and writing in the translated ROS message: encoding 32FC1 and step 3392.

Closing the issue.

Actions #3

Updated by Anthony Mallet 22 days ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF