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

Revision history [back]

I see three main ways do to what you want:

  1. convert the depth image provided by kinect into a laser scan with depthimage_to_laserscan and get the smallest range
  2. process directly the depth image, for example looking for the lowest intensity pixel. For best performance, use a computer vision library as OpenCV
  3. process directly the pointcloud that kinect can also provide, possibly using PCL

An example for way 3 is the turtlebot_follower: doesn't look for the closest obstacle, but for any significatively big obstacle in front of the robot (and follows it). But probably use PCL is a bit overkilling for simple obstacle avoidance....

An example for way 2 is.... the same! I have seem @Tully Foote has rewritten turtlebot_follower in kinetic to use depth image procesed with OpenCV (not 100% sure) instead of PCL

That said, your question is rather vague... can you provide some more details about your plans?