I have an MPU6050 IMU and I would like to mount it on an FSAE car and use it to measure the yaw, pitch, roll, and angular velocities as it drives. As it's impossible to mount it perfectly flat and align the IMU axes with the axes of the car, I am looking for a way to calibrate and compensate for the rotational offset of the car's frame and the IMU's frame.
From the IMU I can get quaternions, Euler angles, raw acceleration and angular velocity data, or yaw, pitch, and roll values. I imagine the solution will involve matrix and trig calculations, but I didn't pay nearly enough attention in multivariable calc to figure this out.