We were unable to compete at Sparkfun AVC at all this year due to issues with our compass. Things were working pretty well during practice the day before although the compass was off by about 10 degrees on the run to the first corner. Here's a video from practice which demonstrates obstacle avoidance kicking in when the vehicle was drifting too close to the hay bales.
So, we attempted to calibrate the compass that evening and when I came back to the site on Saturday morning I found that the compass was off by around 100 degrees. I don't know what we did wrong yet. I did attempt to get another compass working on the day but it used a different interface (I2C) and only returned raw x, y, z values and I'm just not familiar enough with the math for turning those numbers into a heading so after trying various algorithms I found online and getting bad readings, I gave up and switched to being a spectator.
To summarize my performance in different areas:
- The instrumented video really worked well to show me what the issues were and was a huge improvement over looking through log files.
- The use of the LCD display was very helpful to see what was going on during testing.
- The ultrasonic sensors were very unreliable at detecting hay bales and there was huge variance in different batches of sensors that I had. I'm definitely going to switch to LIDAR next time.
- The GPS and navigation logic worked really well as far as I could tell.
- The compass was a disaster, giving totally incorrect readings after we calibrated it.
Apart from being prepared ahead of time next year, a big lesson learned is to have spare parts in case of a component failing. I also need to practice on an enclosed course next time as this is much different to navigating waypoints in a large open parking lot.
This was a pretty intense four weeks building a new autonomous vehicle with Rust and the Raspberry Pi and I learned a lot about both. The project also gave me an excuse to do use Onshape more for designing various mounts that I then 3D-printed.
I'm looking forward to doing much more with Rust and the Raspberry Pi in the future.