Basic Vacuum Cleaner

Basic Vacuum Cleaner


In this practice, we are going to program a basic vacuum cleaner.  The principal difference between a basic vacuum cleaner and an advanced one is that the advanced use a localization algorithm which help the vacuum cleaner to optimize the process, while the basic one just use a movement algorithm trying to clean as mach parts of the house as it can. 

In order to solve this exercise, firstly I tried a simple movement algorithm to learn how to use the api of the program. You can see a video here: see video here



In this video we can see how a simple iterative algorithm, which only make the vacuum run till it bump, and then turn the corresponding time, trying to avoid the obstacles, work.

The next step is to combine a spiral movement with a right line movement for improving the Vacuum cleaner movement algorithm, being able to reach more house floor parts. For this, we are going to use a state machine with 4 states that we can dive in 2 groups:

  • Displacement states
  • Obstacle avoiding state

1) Displacement states:

    Go_forward and Do_spiral are the 2 states which will represent the "free" movement of the robot. When the vacuum is on this states, it is going to move doing a straight line or a spiral till it reached a maximum "going_forward_iteration or do_spiral_iteration" when it will change to the other displacement state.

But that is not all. If we detect an obstacle while we are moving, it will change it state to the correspondent obstacle avoiding state.

2) Obstacle avoiding state:

    Turn_left and Turn_right are the 2 states that we are going to use in order to try to avoid the obstacles that we will during during the displacement. This states will also move backward  during some iterations before turn with the objective of not to get blocked in a corner 

After moved backward during some iterations, we will finally turn to the corresponding   direction during the corresponding iterations 


You can see a video about how the final version of my vacuum cleaner state machine algorithm works here: See video here







Comentarios

Entradas populares de este blog

Autonomous drone for search and rescue mission

Localized Vacuum Cleaner

OMPL Amazon warehouse