How to navigate a maze!
It seems simple enough, but how do you do it autonomously?
First thing we did was to add 3 ultrasonic distance sensors, so Dan-ED always knows how far away it is from a wall. This is really important as Dan-ED has a natural tendency to crash into walls!
The next step was some suitable code to guide Dan-ED through the maze. The Escape Route maze challenge has walls like all mazes but, unusually, some walls are coloured.
We initially tried to use the colour of the walls as a way of deciding which way to turn to escape from the maze. We applied the machine vision code we had developed. It actually worked quite well, reliably detecting the colour of the walls.
In the end we were able to implement much simpler code that purely used feedback from the ultrasonic distance sensors and some clever conditional logic to guide Dan-ED through the maze. It basically tracks the walls, maintaining a constant distance from the tracked wall using measurements from the ultrasonic sensors. There are some simple decision trees guiding whether to turn left or right. The videos explain it a bit better.
The 'telemetry' from Dan-ED shows the 'decisions' that are being made by Dan-ED's maze following code.
Here's Dan-ED navigating the 'Escape Route' maze. We took over the kitchen floor in the middle of the night to test!
Comments
Post a Comment