How got unstuck Opportunity when it got stuck in the martian soil?

I am trying to figure out a Reinforcement algorithm to make the rover get unstuck automatically when it get stuck and starts to sink. Does anyone found any paper or document that describes how the opportunity rover got unstuck from the martian soil?
Last contact with Opportunity was June 10, 2018. Declared dead February 13, 2019.

Original thread: https://forums.space.com/threads/how-got-unstuck-opportunity-when-it-got-stuck-in-the-martian-soil.56352/