Accurate 90 degree turns and straight lines with pololu 3pi

It is a fact of life that gyros drift, especially consumer grade gyros, and the drift is temperature dependent. Only sensor fusion can help with that, and for horizontal turns, a horizon reference like a magnetometer is required.

The magnetometer is very useful but must be carefully calibrated as well. The best tutorial is this one: Tutorial: How to calibrate a compass (and accelerometer) with Arduino | Underwater Arduino Data Loggers

Fully worked example Correcting the Balboa magnetometer

You could also fuse information from wheel encoders, keeping in mind that wheel slip is almost unavoidable.