the way airplanes do it is to get the gyroscope spinning on level ground before moving around, then it stays level enough for the rest of the flight. Accelerometers can be used in much of the same way, but there will be a lot more drift.
You can also use a 2d "gravity driven" inclinometer with a fore-aft accelerometer to account for motion, with a sanity check when the car is not moving. Assuming you do not spend all your time fishtailing.
|