Entradas

Práctica 4: Global Navigation using Teletaxi

Imagen
   Welcome! Picture 1. Taxi in New York Goal: In this exercise we are going to implement the logic of a Gradient Path Planning (GPP) algorithm, which consists of: - Selecting a destination, the GPP algorithm is responsible for finding the shortest path to it, avoiding, in the case of this practice, everything that is not road. - Once the path has been selected, the logic necessary to follow this path and reach the objective must be implemented in the robot. Explanation: First, we have to built a gradient map assigning weights to every cell between the beginning and the target we want to reach. I have choose 2 different values for the weights: 1 for cardinal directions (north, south, east and west) and 1.25 for the intermediate directions (north-east, south-east, north-west and south-west). Next, we have to binarize the map (binarize_map() method) from where we obtain only 2 values, 0 if it´s an obstacle and 255 if it´s road. All the data obtained is copied into a numpy array o...

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...

Práctica 1: Vacuum Cleaner

Imagen
Welcome! Figure 1. Roomba vacuum cleaner Goal: In this exercise we are going to implement the logic of a navigation algorithm for an autonomous vacuum, where the main objective will be to cover the largest area of a house using the programmed algorithm. Explanation: In the first place I have created the function parse_laser_data(), which is attached to the statement of the practice, and whose main functionality is to read the data that the laser collects and with which we will play when deciding the next behavior of our vacuum cleaner. The operation of my vacuum cleaner is based on a state machine, which consists of 4 states: - State 0 (spiral): This state is only performed once in execution, the vacuum cleaner performs a spiral to cover the entire possible area around its initial position, until it detects an obstacle (this is done by reading the values from the front of the laser), and once it detects the obstacle it goes to the next state. - State 1 (reverse): The vacuum cleaner goe...