Entradas

Mostrando entradas de noviembre, 2022

Práctica 3: Obstacle Avoidance

Imagen
  Welcome! Picture 1. Overtaking in an F1 race Goal: In this exercise we are going to implement the logic of the VFF (Virtual Force Field) navigation algorithm, where each object generates a repulsive force towards the robot and it´s destiny an attractive force. Explanation: In this exercise we were asked to design a version of the VFF (Virtual-Force-Field) algorithm, in which an F1 car must travel the circuit taking into account that this time it will have obstacles on the way and you will have to dodge them. First, I've declared three constants, one to check if you've hit the target, and the other two corresponding to the alpha and beta values ​​that will be applied to calculate the resultant force. Then I have implemented the function absolute2relative(), which, as its name indicates, converts the absolute coordinates (point (0,0) at the beginning of the circuit) to relative ones (positive x-axis means forward and positive y-axis means left). The functions corresponding to t...

Práctica 2: Follow Line

Imagen
  Welcome! Figure 1. Formula 1 car Goal: In this exercise we are going to perform a PID reactive control (represented in a Formula 1 car) capable of following the red line painted on the middle on the road of the racing circuit. Explanation: In this exercise we were asked for a program that would allow a F1 car to travel the circuit as fast as possible using image filters and a controller from the PID family. In my case I have opted for a PD controller, whose formula is as follows:                     Picture 2. Controller used in this exercise When I was doing it using this method I have realized something that has seemed quite curious to me, and that is that after numerous attempts giving values to the constants of each controller (Kp and Kd) I have realized that the oscillation of the car is null when both constants have the same value. I have considered the linear speed constant, varying it between a range of 2 and 2.5...