top of page

Goal
The objective of this practice is to implement the logic of a navigation algorithm for an autonomous vacuum. The main objective will be to cover the largest area of ​​a house using the programmed algorithm.

This project will be divided in 2, the first a bump and go and the second, a vacuum cleaner.


Bump and go
    This first exercise is fairly simple, it is just a state machine, which goes forward, when it detects something with the bumper (crashing in to a wall), it saves the bumper that activated (left, middle or right) in a global variable called direction.
    After detecting an obstacle it enters the backing state, goes backwards for 3 seconds, enters the turning state and turns in the direction saved in the direction variable for anther 3 seconds, the it goes forward again.

 

    After changing the program to use rospy.sleep() instead of measuring the time in a while loop and to stabilize the movement (it stops after every change of state, set both speeds to 0 and sleep half a second so that the changes can happend), it is slower but more reliable, as it does not turn while going backwards as it did before.

Vacuum cleaner
    In this second part we will try to clean as much space as possible in a fixed amount of time, first we make a spiral as you can see in the video, then we use the same strategy as in the bump and go, thought this will probably change.
 

    The first implementation was fairly simple, the robot moved making a spiral and when it bumped a wall it started doing the bump and go program, but it was not very effective.
    After that, my second try was to use the laser and follow the walls, if the robot is placed near a wall it will follow it using a PD controller and two angles of the laser to measure the distance, but then the robot had  go to a wall and station itself so that the laser could read the distance and move, which i cloud no do even thought i tried all i cloud think .
    Then i decided in a simpler method, the robot will start in a spiral, when it detects a wall with the laser it will go back and turn, then go forward, it is similar to the bump and go exercise but the laser makes it more precise and if it detects a wide space it will go forward and make another spiral, covering a lot of the terrain.



 

    All the exercises are make by using state machines, the bump and go uses 3 states: Forward, Back and Turning which i will not explain as they are pretty self-explanatory.

The vacuum cleaner uses 4 states, Spiral, that moves the robot making a spiral until it detects an obstacle and turns to the Back state, that goes backwards for a random amount of time, then goes to the Turning states, which turns for a random amount and goes to Forward,  that goes forward until it detects an obstacle, when changes the state to turning, or detects a wide space when changes the state to Spiral.

© 2020 por Alberto Delgado

bottom of page