Well, with all my grand plans for handling the sticky-outy bit with option three, this morning, with the benefit of a good night’s sleep, I asked myself again, why not option 1? As it was I had a spare sensor on the back, picking up readings but never using them for anything. Why not move it around to the right side, mirroring the second sensor on the left side, and allowing me to switch to using a right-hand rule when I got to the sticky-outy bit?
So that’s what I did… There’s sometimes a bit of a scary moment in the middle, when neither the left side sensors nor the right side ones can see a wall, but in this case, the robot just moves blindly forward until it finds one. (It only happens sometimes because the delay between sensor readings means that it doesn’t always take a sensor reading at that point.) Very occasionally it will go off course here and run into the opposite sticky-outy bit, but I think I can tune it further to make this less likely. In fact there’s tuning all round that can be done, because as you can see, it’s not quite making it round cleanly yet. But it gets round. My commit message was “OMG IT GETS AROUND THE MAZE!!!!” 🤣
And perhaps the best thing is: when I checked the straight line speed test just before I packed everything away for the evening, that still works too – I managed not to break it! (Though it also definitely needs some tuning, and won’t be winning any speed prizes.)