Need help to program a mobile robot

Hello SFE hackers, programmers, builders and all , I've been working on my two-wheeled mobile robot I've been trying to attempt to perfect my obstacle avoidance algorithm which is Artificial Potential Field method . Basically for my robot I'm using 5 ultrasonic sensors and detect objects and avoid them. Also i use Arduino Uno kit . The basic concept of the potential field approach is to compute a artificial potential field in which the robot is attracted to the target and repulsed from the obstacles . The artificial potential field is used due to its computational simplicity it just need the locations of obstacles that effected the environment of robot with current position of robot and position of goal . the mobile robot applies a force generated by the artificial potential field as the control input to its driving system . As i understood from Artificial Potential Field method that can be used directly as motion control which generate desired angle to avoid obstacle and reach to the goal with desired speed so the question is , is that means that the program micro-controller is very simple , it just need to write on it the Artificial Potential Field method code without any thing else and the robot will work successfully ??? or that thing is wrong ???

It seems you just need to program the Arduino to do the following loop...

  • read sensors
  • calculate field grid
  • calculate the "force" gradient vector at the position of the robot
  • apply motor outputs to move the robot in the direction and magnitude of the updated "force"

The tough part is calculating your field grid.

You might consider taking Sebastian Thrun's excellent course on Udacity teaching how to program a robotic car.

I don't know much about this, so cannot answer any questions. However, this is an arcane enough subject that it pays to do some background research as a first step. The technique has been around for a long time,

http://www.google.com/custom?q=robotics+potential+fields

One problem with this method, like many that are "too" simplistic, is that the robot can get caught in a "local minima" in the field, and loop forever. So, like "everything else" in robotics, you need multiple techniques [and also sensors] that complement each other.

charliesixpack: It seems you just need to program the Arduino to do the following loop...

  • read sensors
  • calculate field grid
  • calculate the "force" gradient vector at the position of the robot
  • apply motor outputs to move the robot in the direction and magnitude of the updated "force"

The tough part is calculating your field grid.

You might consider taking Sebastian Thrun's excellent course on Udacity teaching how to program a robotic car.

dear Mr. charliesixpack many thanks to you , yes that really what i want to do and I have already programmed the algorithm by using Matlab and it well done , but the problem is how to program it by using Arduino language ,

oric_dan:
I don’t know much about this, so cannot answer any questions. However, this is an arcane enough subject that it pays to do some background research as a first step. The technique has been around for a long time,

http://www.google.com/custom?q=robotics+potential+fields

One problem with this method, like many that are “too” simplistic, is that the robot can get caught in a “local minima” in the field, and loop forever. So, like “everything else” in robotics, you need multiple techniques [and also sensors] that complement each other.

Dear oric_dan many thanks

yes that is right the algorithm is suffered from “local minima” problem and i solved that by combined it with fuzzy logic control but first i just want to apply the algorithm practically even with “local minima” problem .

Except for minor syntax issues, everything you show is almost identical to C language, so moving it to Arduino is trivial. If you don't know C, you need to learn it first. Easy enough to do.

The problem may come in if you are using libraries and functions unique to Matlab, eg whatever the following means. Duh ????

function [qx,qy,v,th,sp]=apf(xc,yc,sf,sl,sr,anf,anl,anr)