Minimal Maze

To keep with the tradition of PiWar’s ‘kitchen and makeshift maze’ others started 🙂



5 thoughts on “Minimal Maze

  1. Thanks. Turning the corner is real pain. I was going back and forth between cheating (waiting speed specific time and just turn) and have rover ‘wait for wall to run out to start turning’ and currently it is something in between as waiting effectively adds needed delay. But the algorithm is flawed for (when hugging wall on the left) when wall turn away (left again) it detects ‘running out of the wall’ and continues straight into the opposite wall. Only timeout prevents it from hitting it…


    1. Your sensor looks interesting – I like the way it moves around. We’re just using 2 static ones, one of the left and one looking ahead. Haven’t got the turning yet but when they’re both looking either side they do a good job for the straight line speed test.


  2. Looking forward at 45º detects ‘end of the wall’ way too soon (distance / sqrt(2) mm too soon) – only visible downside of not having two sensors as you. That’s the reason it, then, quickly turns to 90º hoping to detect the same wall and then waits for it to ‘run out’ as well.
    All of it is fine – until rover ‘bounces’ too far from the wall, making 45º to the wall going closer to the 90º and it then falsely detects ‘wall end’. That’s why when sensor turns back to 90º it has short timeout to ‘find’ the wall and if it fails to do so (because it is too far(*)) it reverts to turning towards it thinks wall is (was).
    (*) since we can move sensor around – at the beginning we scan both 90º and -90º add up distances and then divide them by 2 to get ‘ideal’ distance from the wall (times sqrt(2) for distance at 45º). Huh – did I manage to explain it or confuse it even more! 🙂
    Your two sensors make is much easier as you have instant response from both sides and can make far better decision to where the wall really is…


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s