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

I have been able to obtain the distance with a very simple line of code...

double distance;
distance = 0.001*cv_ptr->image.at<u_int16_t>(cv_ptr->image.rows/2, cv_ptr->image.cols/2);

This gives me the distance of the object in the center of the image.

I have been able to obtain the distance with a very simple line of code...

double distance;
distance = 0.001*cv_ptr->image.at<u_int16_t>(cv_ptr->image.rows/2, cv_ptr->image.cols/2);

This gives me the distance of the object in the center of the image.image. In meters.