DepthMap With ROS

394 views
Skip to first unread message

DK

unread,
Feb 4, 2011, 3:04:06 PM2/4/11
to openn...@googlegroups.com
Hi there,

I'm pretty new to OpenNI and ROS so do pardon me if this is a silly question.

I would like to obtain the depth map of each individual pixel with a Kinect on ROS. Yes I know that PointClouds do just that but they publish too slowly for my application which requires real-time information. 

Is there a way to obtain just the depth map using something like "const XnDepthPixel* pDepthMap = depth.GetDepthMap(); " in ROS using some published messages?

Much thanks.

Dave

Suat Gedikli

unread,
Feb 4, 2011, 4:00:30 PM2/4/11
to openn...@googlegroups.com
Hi,

yes... you the depth image is published in the topic
"/camera/depth/image" also the disparity image is published.
Just run "rostopic list" to see what topics were published.

cheers,
Suat

> --
> You received this message because you are subscribed to the Google
> Groups "OpenNI" group.
> To post to this group, send email to openn...@googlegroups.com.
> To unsubscribe from this group, send email to openni-dev
> +unsub...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/openni-dev?hl=en.


DK

unread,
Feb 4, 2011, 5:12:36 PM2/4/11
to openn...@googlegroups.com
Thanks for your reply Suat.

The depth image is returned in "sensor_msgs/Image" format which stores the information in uint8 data[].

Is this "data" my depth information? I wrote a program to print out this information and it hardly seems correct. I was thinking that the depth information is stored as a metadata array called depth_md[]. Is that assumption correct and if so, how do I extract that from the publications?

Thanks.

Dave

Suat Gedikli

unread,
Feb 4, 2011, 5:51:03 PM2/4/11
to openn...@googlegroups.com
Hi,

yes depth_md stores the depth info, but we publish a sensor_msgs/Image
in the topic "/camera/depth/image" which has following encoding:
"sensor_msgs::image_encodings::TYPE_32FC1". So it contains floating
point values which are the z-values for each pixel in the device
coordinate frame. They are in meters - the original depth_md contains
the z-values in millimeters.

I hope, i could help you.

Suat

Reply all
Reply to author
Forward
0 new messages