I've been tasked with creating a maze solver robot, that only has one ultrasonic sensor that's fixed and forward facing. I've devised a basic algorithm to handle obstacles (walls) and make turns, but the algorithm cannot find new paths if the new path is not at an 'ending' (wall). This is shown below, where the red path will not be detected by the robot:
The above seems to be the only catch in the algorithm I have. Because I only have one fixed sensor, how can I approach this without having the robot stop at random and have a look around?
The above seems to be the only catch in the algorithm I have. Because I only have one fixed sensor, how can I approach this without having the robot stop at random and have a look around?
Its not possible if you dont look for something it will never be there.
The only way would be to put the ultrasonic on a rotating servo which there are hundreds of examples online.
In firefighting, a technique called a right (or left) handed search is used. In a blind situation (smoke, etc), the searcher would find a wall, and keep it on their right (or left), and follow it, sweeping their axe handle all around them to find obstacles or victims. Eventually they will return to their origin point.
Angle your sensor in such a way that it can trace the wall to one side, yet still see walls in front (45 degrees forward?). This way it should never miss an opening. If the opening is on the opposite side of the sensor, it will still eventually reach that opening again when it is on the right, if it has not already solved the maze.
So you'll have 3 scenarios with a right facing sensor:
Distance is constant, path is straight ahead, continue straight.
Distance is increasing, path opens to the right, turn right.
The trouble with ultrasound is, if you angle the sensor, the chances are that you won't see a direct echo from the first contact - I've had devices bump into hard skirting boards because the approach was not square-on.