Obstacle Avoidance

GOAL

The goal of this exercise is to implement the logic of the Virtual Force Field (VFF) navigation algorithm in a car who has to avoid obstacles in a race.

obstacle init

You can find all the information about this exercise in JdeRobot Academy

THEORY

In this exercise we have to use two tipes of navigation , global and local navigation. Global Navigation involves the use of a map of the environment to plan a path from point A to point B. Local Navigation involves a dynamically changing path plan taking into consideration the changing surroundings and the vehicle constraints. The virtual Force Field Algorithm generate an atractive vector (force) to the waiypoint that points towards the waypoint. The robot assigns a repulsive vector to the obstacle according to its sensor readings that points away from the waypoint. This is done by summing all the vectors that are translated from the sensor readings.The robot follows the vector obtained by summing the target and obstacle vector.

Virtual Force Field

MY IMPLEMENTATION

For the implementation i have create three forces: Atractive force: Is a vector from the robot to the target. To implement this vector i had to convert the absolute target coordinate to relative (formula 1 coordinates). Repulsive force: Is a vector obtained by the sumatory of all the repulsive forces. Repulsive forces are vectors from the obstacles to the robot, if the robot is near an obstacle, the repulsive force is high. This type of repulsion makes the car always prefer to be in the center of the circuit if there are no obstacles because lateral forces balance. Resultan force: The resultant force is generated based on those mentioned above. I calculate it following an acuation with especific parameters to each force.

Resultant force = A(Atractive force) + B(Repulsive force)

You can see the final simulation in this link. Youtube link