Keeping the rover right side up and balanced
The rover's Inertial Measurement Unit (IMU) uses gyroscopes and accelerometers to determine the heading and tilt of the rover. The gyroscopes measure small heading changes very accurately, and the accelerometers measure where gravity is strongest, pulling down on the rover. Having knowledge of where gravity (down) is, the rover can partly assess its orientation. The rover will also use its tilt sensors to prevent rollover.
If the IMU fails or the rover is lost, the flight team can use the Pancam, which is not part of the autonomous system, to try to figure out the rover direction and position relative to the horizon (attitude).
[Next part of the story]