While waiting for parts to come in for SAGAR, I decided I’d kill three birds with one stone. I wanted to adapt my Irobot command code to be compatible with Webbot’s Lib, I wanted to test Webbot’s new Project designer, and I wanted to try out a Force Field Obstacle Avoidance Algorithm. This is what I came up with.
It’s an Irobot Create, controlled by an Axon 2 running Webbot’s Lib, a Sharp IR and a standard servo. Theoretically, obstacles in front of the robot will ‘repel’ it while free space ‘attracts’ it. The closer and more directly in the way an obstacle is, the more it ‘repels’ it away.
With Webbot’s new hardware project designer, it was a breeze to setup all the hardware, and I was programming in minutes. All in all my algorithm is only about 50 lines long. Everything else is taken care of by Webbot Lib and project designer.
UPDATED: Source added. It’s not commented and messy, so be warned. Download Source
Video in action:
Click to enlarge