I just want my bot to wander around avoiding obstacles

Is there any code out there that will just let my bot wander around exploring while avoiding obstacles using Sonar alone?

No fiducials, no Lidar, no maps, no goals…just wandering around?


@FolsomMike This is why a forum is good. Mike has brought up yet another fun and instructive sort of ‘learning’ app. I like it when these fairly obvious requests come in. So it’s on my list although I cannot promise any fast timeframe. Thanks.

To make it more accessable for persons to mess with I suspect I would do such a node in our demos repository as a python node which is the easiest sort of node to just mess around with.

It would subscribe to our sonars and perhaps just use front one and the two that point 45 deg to either side. Then decide on some basic few rules to get it out of situations such as turn to right or left and go again. I have this sort of thing programmed on a few of my own bots already although in some of those cases it is using edge sensors to stay on a table.

Thanks, Mark

1 Like

I have created sonar_wanderer which is a very simple minded avoider.
The idea is to let people play with it and learn. That is our main goal here by the way, learn.

To see this code go to https://github.com/UbiquityRobotics/demos. It will be in folder sonar_wanderer

You can on your Magni do a cd ~/catkin_ws/src/demos then do ‘git pull’

Then cd ~/catkin_ws and use ‘catkin_make’ after that you can start the node

I STRONGLY SUGGEST YOU MAKE THE RF remote Estop switch before you let this thing run about. Don’t have it in or near any nice furnature or anything without setting up the remote RF ESTOP switch or following it around and lift its wheels and hit red estop switch if you suspect it has gotten ‘confused’

SO USE THIS IN A PLACE WHERE IF IT HITS SOMETHING YOU CAN GO TO IT AND STOP IT. YOU HAVE BEEN WARNED!!! Totally beta code … why? because we want you to learn about robots!