top of page
Buscar
  • Foto del escritorCarlos Caminero

Obstacle Avoidance

Actualizado: 29 ene 2021


In this proyect we have used again the formula 1 car, with the new skill: it has laser 180º. Thus, we can detect obstacles. The objective is to make a complete turn around the circuit, with the difficulty that during the tour there will be several cars as obstacles.


I have used the VFF (Virtual Force Field) to obtain this goal.


- VFF (Virtual Force Field):

Two main vectors are show: attraction vector ( vector points to next objetive ) and repulsion vector ( it is the sum of repulsion vectors of lasers ). The resultant vector will be the weighted sum of attraction vector an repulsion vector.


-The red vector is the attraction vector. It points to the next Objetive


- The green vector is the repulsion vector. Is the sum of all vector os laser reduced by a scale factor


- The black vector is the resultant vector.


Steps I have followed:


1) Repulsion Vector. To obtain this vector, first, I used only a laser of all 180. For example, the laser 60. Then, I put an object near the car and it hit the laser. We obtain the distance and then I draw the opposite laser using a inversely proportional scale factor. Thus, with nearby obstacles the vector increases. Once achieved, we add all the lasers. You will notice that the sum is very very long, but adjusting well the scale factor, we can obtain a repulsion vector with a decent size.


2) Attraction Vector. We have obtained this vector using a function, that given as arguments the position of the car, the direction of yaw and the destination position, it returns a vector to be represented in the graphical interface. For this, geometric transformations have been carried out (rotation with yaw). Then, I have obtain the distance to objetive using Pitagoras theorem and then I applied Tales Theorem to get a vector with the same length.


3) Obtain scale factors and alfa / beta.

For that, we have used OpenCV to create a simple GUI with sliders for obtain the best values for this constants.

And then, alfa = 0.5, beta = 0.3, scale_factor of laser = 0.2, and scale factor of destiny = 9 (the length of red vector)


And thus, the result is the following:

Note: Sometimes, I have noticed that depending on the computational load of the computer, the algorithm works fine most of the time and other times a little regular


91 visualizaciones0 comentarios

Entradas Recientes

Ver todo
bottom of page