Wednesday, June 2, 2010

Navigate a point robot to a target using force fields

Suppose we have a punctiform omnidirectional robot and we want to navigate it toward a target. There are many techniques to achieve this goal, but for this first tutorial I want to propose you the the method that I consider the easiest one: the use of force fields. In this approach the target attracts the robot like a gravitational field and obstacles have an opposite force that keeps the robot away.
In this way the robot goes directed toward the targets, keeping distant from the obstacles.
Let's analyze the details of this model.

The obstacles:
Every obstacle has a force field that keeps the robot away. The formula of the force of this field is built by using the Newton gravitation formula, but assigning a negative mass to the obstacle. This because we don't want the robot to be actracted by obstacles. The principle is that the force must be inversely proportional to the square of the distance:
F(o) = o.m / ( o.dist^2 )
where o is the obstacle and m is the mass.
To allow the robot to pass near the obstacles at low speed we can make the field proportional to the speed of the robot:
F(r,o) = k*r.speed*o.m / ( o.dist^2 )
where r is the robot and k is a proportional parameter.
In order to make computation easiest for the computer we can say that the field is activated only when the robot is near the obstacle:
if(dist
F(r,o) = k*r.speed*o.m / ( o.dist^2 );
}
else{
F(r,o) = 0;
}

The goal:
The formula for the goal field should be a little bit different. In fact if we use a force that is inversely proportional to the square of the distance we would have a slow start when the robot is far from the target and infinite acceleration when the robot is near the goal. Actually we want the inverse behavior.
So we define the force as directly proportional to the distance:
F(g) = g.m * g.dist

The robot:
As we said, our robot can go in any direction so we simply use the sum of all forces to find the robot acceleration. Then we use acceleration to find the robot speed. We always talked about a robot that navigate a 2-dimensional space, but immagine this space 3-dimensional or n-dimensional. Actually this space could be the C-Space of a n dof manipulator.

Pros:
+ easy method
+ smooth path if parameters are well setted
+ relative fast computation
+ good even in a dynamic world

Cons:
- necessity to trim parameters
- suffers of local optimals
- not suitable for even small complex scenarios (eg. labyrinths)

Possible applications:
- Homing missiles or torpedos
- Space ships
- Robot arms in simple environment
- Support for higher level path planners

Here's a simple applet that uses field forces to navigate a ball-robot to a ball-goal, avoiding ball-obstacles:

No comments: