Pi Wars Week -20: Back in the driving seat

A quick update: circumstances conspired to stop me working on the robot over the past couple of weeks, but I'm back at it and testing/tuning the autonomous driving challenges. Last time I had something that would just about follow the white line of the Lava Palaver around a corner, so in the intervening time I built and painted a mockup of one S-bend to make sure the robot was an ambi-turner (it wasn't) and start tweaking the settings to make sure it reliably followed the line.

I also modified the approach we've used on the maze course for the last couple of years to work in a slightly more generic way which means it's actually surprisingly adept at navigating unfamiliar surroundings, as this video shows

External factors

One simple technique that's saved me uncountable time in this part of the process: loading autonomous driving constants from a file when running challenge code, the same way we did with the white balance values in episode 4. It's tempting to stick the PID gains in local variables and go round a "change -> save -> restart code -> test" loop, but as my code takes about 15 seconds to boot up that would quickly add up to a lot of time. Having the gains loaded from an external file in the run() method means I don't have to restart the entire Python program every time I tweak the values, so now I can tune by just changing the values in the PIDgains.txt file and running the challenge from the menu.

- PKM