A method comprising: receiving, at data processing hardware, a maneuver for a legged robot and a current state of the legged robot , the maneuver comprising one or more movement events for the legged robot to perform; transforming, by the data processing hardware, the maneuver and the current state of the legged robot into a nonlinear optimization problem , the nonlinear optimization problem configured to optimize an unknown force and an unknown position vector, wherein a torque of the legged robot is measured based on the unknown force and the unknown position vector; at a first time instance (I 1 , t 0 ): linearizing, by the data processing hardware, the nonlinear optimization problem into a first linear optimization problem ; and determining, by the data processing hardware, a first solution to the first linear optimization problem using quadratic programming; characterized by the method further comprising: at a second time instance (I 2 , t 1 ) subsequent to the first time instance (I 1 , t 0 ): linearizing, by the data processing hardware, the nonlinear optimization problem into a second linear optimization problem based on the first solution ; and determining, by the data processing hardware, a second solution to the second linear optimization problem based on the first solution using the quadratic programming; and generating, by the data process hardware, a command to control the legged robot to perform the maneuver based on the second solution . receiving, at data processing hardware, a maneuver for a legged robot and a current state of the legged robot , the maneuver comprising one or more movement events for the legged robot to perform; transforming, by the data processing hardware, the maneuver and the current state of the legged robot into a nonlinear optimization problem , the nonlinear optimization problem configured to optimize an unknown force and an unknown position vector, wherein a torque of the legged robot is measured based on the unknown force and the unknown position vector; at a first time instance (I 1 , t 0 ): linearizing, by the data processing hardware, the nonlinear optimization problem into a first linear optimization problem ; and determining, by the data processing hardware, a first solution to the first linear optimization problem using quadratic programming; characterized by the method further comprising: linearizing, by the data processing hardware, the nonlinear optimization problem into a first linear optimization problem ; and determining, by the data processing hardware, a first solution to the first linear optimization problem using quadratic programming; characterized by the method further comprising: at a second time instance (I 2 , t 1 ) subsequent to the first time instance (I 1 , t 0 ): linearizing, by the data processing hardware, the nonlinear optimization problem into a second linear optimization problem based on the first solution ; and determining, by the data processing hardware, a second solution to the second linear optimization problem based on the first solution using the quadratic programming; and linearizing, by the data processing hardware, the nonlinear optimization problem into a second linear optimization problem based on the first solution ; and determining, by the data processing hardware, a second solution to the second linear optimization problem based on the first solution using the quadratic programming; and generating, by the data process hardware, a command to control the legged robot to perform the maneuver based on the second solution . <EOS>