ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Random Movement while avoiding obstacles

asked 2022-01-24 12:01:23 -0500

MiPlayer gravatar image

updated 2022-01-24 12:58:48 -0500

Hello. I am fairly new to ROS and I am wondering if there is a way for me to make a robot move randomly. I currently have a rplidara1 and tracking camera for Odom, which can perform mapping and navigation. The robot just needs to move a few feet in any direction while avoiding obstacles repeatedly (without a map). I am wondering how to go about doing this.

[Note, similar unanswered question here

edit retag flag offensive close merge delete


The link you've provided doesn't seem to be clickable (probably due to a mismatch of brackets).

cst0 gravatar image cst0  ( 2022-01-24 12:20:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-01-24 12:24:48 -0500

cst0 gravatar image

Here's what I would do:

  1. Subscribe to the local costmap topic being generated by your obstacle avoidance stack
  2. Get the range of points within this local costmap
  3. Pick an x value and a y value at random between these points
  4. Check if that point is marked as 'clear' by the costmap
  5. If it is, go there
  6. If it isn't, pick a new point
edit flag offensive delete link more


Ok, thanks. I will look into it and update here.

MiPlayer gravatar image MiPlayer  ( 2022-01-24 22:25:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-01-24 12:01:23 -0500

Seen: 46 times

Last updated: Jan 24 '22