A method operable by a computing device, the method comprising the operations of: determining an orientation of a bottom surface of a legged robotic device with respect to a ground surface , wherein the legged robotic device includes two or more legs (304A-D) extending from a body of the legged robotic device; based on the determined orientation, determining that the legged robotic device is in an unstable position, wherein the legged robotic device is unable to maintain a stance in the unstable position; providing, by the computing device, instructions to perform a first action configured to return the legged robotic device to a stable position such that the legged robotic device is able to maintain a stance in the stable position, wherein the first action includes moving a first leg of the legged robotic device from a first position to a second position, such that a distal end of the first leg is further away from the ground surface in the second position than in the first position, and wherein a proximal end of the first leg is coupled to a first side of the legged robotic device; if the legged robotic device is in the stable position after the first action, providing, by the computing device, instructions to extend at least two of the two or more legs of the legged robotic device; and if the legged robotic device is in the unstable position after the first action, providing, by the computing device, instructions to perform a second action configured to return the legged robotic device to the stable position, wherein the second action includes extending the distal end of the first leg of the legged robotic device away from the body of the legged robotic device such that a gravitational potential energy of the legged robotic device is increased. determining an orientation of a bottom surface of a legged robotic device with respect to a ground surface , wherein the legged robotic device includes two or more legs (304A-D) extending from a body of the legged robotic device; based on the determined orientation, determining that the legged robotic device is in an unstable position, wherein the legged robotic device is unable to maintain a stance in the unstable position; providing, by the computing device, instructions to perform a first action configured to return the legged robotic device to a stable position such that the legged robotic device is able to maintain a stance in the stable position, wherein the first action includes moving a first leg of the legged robotic device from a first position to a second position, such that a distal end of the first leg is further away from the ground surface in the second position than in the first position, and wherein a proximal end of the first leg is coupled to a first side of the legged robotic device; if the legged robotic device is in the stable position after the first action, providing, by the computing device, instructions to extend at least two of the two or more legs of the legged robotic device; and if the legged robotic device is in the unstable position after the first action, providing, by the computing device, instructions to perform a second action configured to return the legged robotic device to the stable position, wherein the second action includes extending the distal end of the first leg of the legged robotic device away from the body of the legged robotic device such that a gravitational potential energy of the legged robotic device is increased. <EOS>