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

How can I tell the distance from a turtlebot to an obstacle?

asked 2016-06-29 11:04:18 -0600

Vinh K gravatar image

updated 2016-07-08 13:14:33 -0600

Hi all,

I am working on obstacle avoidance using turtlebot with kinect sensor. I need help with determining how far an obstacle is from the turtlebot. I want to use this process to incorporate it into a multiple robots where they will move and avoid obstacles.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-29 13:09:46 -0600

jorge gravatar image

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?

edit flag offensive delete link more


We are working on a multiple turtlebots for formation change. Our plan is to be able to change formation when there is a barrier so multiple robots can pass through a gate.

Vinh K gravatar image Vinh K  ( 2016-06-29 14:09:11 -0600 )edit

is there a code in c++ out there I can use for reference? We are planning to do an obstacle avoidance where we will expand into multi turtlebots.

Vinh K gravatar image Vinh K  ( 2016-07-08 12:39:04 -0600 )edit

based on method 1. depthimage_to_laserscan how can I detect how far a target is?

Vinh K gravatar image Vinh K  ( 2016-07-18 14:58:05 -0600 )edit

Question Tools



Asked: 2016-06-29 11:04:18 -0600

Seen: 1,745 times

Last updated: Jul 08 '16