0
$\begingroup$

Rosanswers logo

Hey everyone,

I'm using the kinect and Openni_launch to publish a pointcloud (pcl::point). I want to extract the distance of a point given the pixel coordinates of that point.

so lets say, in the 640x480 pixel matrix, I want to extract the depth at cell 100x100. I thought of using sensor_msgs::PointCloud2 and sensor_msgs::RegionOfInterest. But I can't find out how to make them work together.

I currently have:

void roiing(sensor_msgs::RegionOfInterest roi) { roi.x_offset = 100; roi.y_offset = 100; roi.height = 1; roi.width = 1; roi.do_rectify = false; }

and then some Functions to subscribe to topics and do processing..

The region of interest doesn't change anything and I was wondering how I can make it work ? I can't find any code online where the RegionOfInterest message is used.

Thanks


Originally posted by samesimasemsom on ROS Answers with karma: 11 on 2012-02-20

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Is there somewhere specific that tells you to use a RegionOfInterest message? You can access a specific point from an organized pointcloud (which the openni driver produces) by using cloud.at(u,v).

Alternatively, if you just want the depth, you can subscribe to the depth image, and just index into the image, which will provide you with the depth.


Originally posted by Dan Lazewatsky with karma: 9115 on 2012-02-20

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.