After watching an animation of how the Spirit rover landed on Mars, I was wondering how the rover managed to end up the right way up after bouncing around?
Mars Pathfinder, Spirit, and Opportunity all could come to rest on any of four sides of the tetrahedral-shaped lander. Just by chance, Mars Pathfinder and Spirit landed with the base petal down. However Opportunity landed on one of the side petals.
The system was, of course, designed for that. The three side petals all have motors to drive them open to be co-planar with the base petal. The computer detects which side is down using the accelerometer in the inertial measurement unit. For Opportunity, the side petal that was down was driven open first. The motor had more than enough torque for that side petal to push the whole lander over so that it fell onto the base petal. Then the other two petals opened.
This video shows a side petal landing at 3:50.