Práctica 1: Vacuum Cleaner
Welcome!
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 goes in reverse for a short period of time, and we create a variable that contains a bounded interval of random numbers that will be used in the next state to configure the direction of rotation and the angular velocity of vacuum.
- State 2 (turn): The vacuum cleaner turns for a short period of time, the direction of which is determined by the bounded interval of random numbers that we created in the previous state. Once it has made the turn, it goes to the next and last state.
- State 3 (forward): Once the turn is complete, the vacuum cleaner goes in a straight line continuously until it detects an obstacle through the values taken from the front of the laser, returning to state 1 (reverse), and repeating the whole process mentioned above.
Picture 2. State diagram
MULTIMEDIA CONTENT (SIMULATION IN UNIBOTICS):
Image: View of the house
Picture 3. Environment visualization
Video: Execution of the program
Picture 4. Execution of the program
Picture 5. Result of the program after 20 minutes working


Comentarios
Publicar un comentario