Embedded Motion Control 2019 Group 9: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
Line 33: Line 33:


= Escape room challenge =
= Escape room challenge =
For this assignment, we decided to work out two different strategies. The first one is the wall following strategy and the second one is the exit detection strategy. The idea was that the detection, drive control and world model code could be shared between both strategies and that only the planning module would be different. The code that was used in the challenge uses the wall following module.
In the initial design plan that we wrote, we were a bit too optimistic about mapping and localization. Implementing these functionalities appeared to be harder than we thought. That is why we will present an updated version of the most important information from the initial design plan here.
{| border="1" cellpadding="5" cellspacing="1" style="margin-left: auto; margin-right: auto;"
! Wall following
! Exit detection
|-
| PICO has to avoid all walls at any time.
| PICO should always stay always stay away from walls at least 15 centimeters.
|-
|
| PICO should aim for an equal distance to the right and left when moving through a corridor between 0.5 and 1.5 meters.
|-
| PICO should complete its task well independent of the initial conditions.
| PICO has to scan its surroundings with a frequency of at least 5 Hz while moving to prevent bumping into a wall.
|-
| PICO should operate fully autonomously.
| The final software should not make use of teleoperation.
|-
| PICO cannot translate or rotate faster than prescribed.
| The maximum translational velocity of PICO is 0.5 m/s and the maximum rotational velocity of PICO is 1.2 rad/s.
|-
| PICO has to deal with small imperfections in the real world it operates in.
| An uncertainty margin of 0.05 meter should be present when building a world model to deal with imperfections in the real world.
|-
| The software should be easy to set up.
| The software should be set up according to the information on the wiki page.
|-
| PICO has to cross the finish line as fast as possible within the maximum time of 5 minutes.
|
|-
| PICO needs to stop when it crosses the finish line.
| PICO needs to stop after it has entered the corridor and there is more than 1 meter distance to the left and to the right
|-
| PICO has to identify the exit of the escape room.
| An algorithm is created which ensures that PICO identifies an exit between 0.5 and 1.5 meters wide when facing the exit under an angle of 60 degrees or less.
|-
| PICO has to keep looking for the exit if it cannot find the exit.
| PICO will drive towards the point furthest away from at that moment if the exit is not detected.
|}
<br>


Code architecture:
Code architecture:

Revision as of 11:11, 17 June 2019

Group members


Nicole Huizing | 0859610
Janick Janssen | 0756364
Merijn Veerbeek | 0865670

Design Documents

The Initial Design document can be found here: File:Initial Design Group9.pdf

The powerpoint presentation about the design is in this file: File:Presentation initial design.pdf

The powerpoint presentation about the final design can be found here: File:Presentation final design group9.pdf

Logbook

The composition of group 9 has changed twice. At first, George Maleas decided to quit the course at the 13th of May, two days before the escape room competition. At second, Merijn Floren also quit the course on the 3rd of June. The motive for both students was that they lacked the c++ programming skills to meaningfully contribute to the project. Participating in the course would take a too large investment of their time. The code for the final challenge was written by Janick Janssen, Merijn Veerbeek and Nicole Huizing.

Initial design

<<Mostly based on hospital challenge. Some remarks for escape room challenge can be made.>>

Requirements

Janick

Functions

Janick

Components

Janick

Specifications

Janick

Interfaces

Merijn

Escape room challenge

For this assignment, we decided to work out two different strategies. The first one is the wall following strategy and the second one is the exit detection strategy. The idea was that the detection, drive control and world model code could be shared between both strategies and that only the planning module would be different. The code that was used in the challenge uses the wall following module.

In the initial design plan that we wrote, we were a bit too optimistic about mapping and localization. Implementing these functionalities appeared to be harder than we thought. That is why we will present an updated version of the most important information from the initial design plan here.

Wall following Exit detection
PICO has to avoid all walls at any time. PICO should always stay always stay away from walls at least 15 centimeters.
PICO should aim for an equal distance to the right and left when moving through a corridor between 0.5 and 1.5 meters.
PICO should complete its task well independent of the initial conditions. PICO has to scan its surroundings with a frequency of at least 5 Hz while moving to prevent bumping into a wall.
PICO should operate fully autonomously. The final software should not make use of teleoperation.
PICO cannot translate or rotate faster than prescribed. The maximum translational velocity of PICO is 0.5 m/s and the maximum rotational velocity of PICO is 1.2 rad/s.
PICO has to deal with small imperfections in the real world it operates in. An uncertainty margin of 0.05 meter should be present when building a world model to deal with imperfections in the real world.
The software should be easy to set up. The software should be set up according to the information on the wiki page.
PICO has to cross the finish line as fast as possible within the maximum time of 5 minutes.
PICO needs to stop when it crosses the finish line. PICO needs to stop after it has entered the corridor and there is more than 1 meter distance to the left and to the right
PICO has to identify the exit of the escape room. An algorithm is created which ensures that PICO identifies an exit between 0.5 and 1.5 meters wide when facing the exit under an angle of 60 degrees or less.
PICO has to keep looking for the exit if it cannot find the exit. PICO will drive towards the point furthest away from at that moment if the exit is not detected.



Code architecture:

World Model

Nicole

Detection

Nicole

Controller

Nicole

State manager

Nicole

Wall follower

explanation & movie of simulation & movie of real challenge & discussion on approach - Nicole

Exitfinder

explanation & movie of simulation (do we have something useful?) & discussion on approach - Janick

Hospital challenge

World model

Merijn

Perception

Janicks

Also simulation movie of updating map possible?

Localization

Merijn

Path planning

Nicole

Global path planning

The hospital is divided in structs 'room'. This is done both to preserve the semantics and for practical purposes: it reduces computation time for local path planning and it makes it easy to call information about corners and cabinets in the proximity of Pico. A 'door' is a separate struct. The connections between all rooms and doors are stored in a graph. A vector 'globalPath' is filled by repeatedly choosing the connected door/room with the highest ID-number (if there are more possibilities). ID's that are already in the path are ignored to prevent Pico from walking in a loop. When a doorway is blocked, the connection will be removed from the graph. The route calculated in this way is not per definition the fastest route, but this is not needed to succeed in the challenge.

Each cabinet and each door have a unique enter-gridpoint. These points are used for local path planning. As the "large door" connecting the two parts of the hallway could be partly obstructed, three enterpoints are assigned to this door. If no obstruction is present, the middle node will be used. The enterpoints can be viewed as white circles in the image left below.

Local path planning

To plan Pico's path between enter-gridpoints, use is made of an A* pathplanning algorithm. This method was chosen over Dijkstra's method because it is faster. We will choose a heuristic function that is admissible, so it will be guarenteed that A* will give the shortest path from start to end.

All grid points on the map come with a boolean "accessible". Points that are close to a wall or an object receive the value 'false'. Mapping new objects is also based on this principle: whenever a new static object is detected, the gridpoints it covers will become unaccessible.

After the A* function is called with a certain start-gridpoint and end-gridpoint, it first goes through some checks. These checks assess whether the startposition and endposition are accessible and whether the startposition is the destination itself. If the startposition is unaccessible, the gridpoint itself and the points directly around it are temporarily made accessible (this is needed when Pico accidentally got too close to a wall or object).

Next, the start-node is put in the open list. At every cycle of the loop, the node in open list with the smallest f-value is evaluated. The f-value of node n is the sum of the cost of the path from start to node n and the heuristic cost of that node. This current node is put in the closed list. Next, the eight nodes around it are evaluated. If one of the nodes is the destination, the path from start-node to destination-node is reconstructed. If not, the cost-functions of these nodes are updated and if they are not yet in the closed list, they will be added to the open list from which the node with the lowest f-value will be evaluated in the next loop.


Grid map with door- and cabinet-enterpoints
Grid map with A* route

Finite state machine

Merijn

Results

Nicole

The video below shows the performance of Pico in the final challenge. We have to say that this is not exactly the result we hoped for. As can be seen, Pico has difficulties finding the entrance of the first room. This problem is due to an unfixed bug in Pico's localization. Pico manages to determine it's global route to cabinet 0. He starts it's local route to it's first destination: the doorway of the first room. However, he turns a bit too far and heads to the corner of the doorway. Pico is programmed to step back when he is too close to a wall. After reaching a certain backward distance, Pico relocalizes itself and recalculates a path to it's destination. However, due to the problem in localization, he thinks he is outside the zone where he expects himself to be. He now re-takes the old route until he gets too close to the wall again and stays in this loop forever.

Hospital challenge performance

Discussion

Janick