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 (222, 222a); and determining, by the data processing hardware, a first solution (232, 232a) to the first linear optimization problem (222, 222a) 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 (222, 222b) based on the first solution (232, 232a); and determining, by the data processing hardware, a second solution (232, 232b) to the second linear optimization problem (222, 222b) based on the first solution (232, 232a) 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 (232, 232b). 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 (222, 222a); and determining, by the data processing hardware, a first solution (232, 232a) to the first linear optimization problem (222, 222a) 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 (222, 222a); and determining, by the data processing hardware, a first solution (232, 232a) to the first linear optimization problem (222, 222a) 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 (222, 222b) based on the first solution (232, 232a); and determining, by the data processing hardware, a second solution (232, 232b) to the second linear optimization problem (222, 222b) based on the first solution (232, 232a) using the quadratic programming; and linearizing, by the data processing hardware, the nonlinear optimization problem into a second linear optimization problem (222, 222b) based on the first solution (232, 232a); and determining, by the data processing hardware, a second solution (232, 232b) to the second linear optimization problem (222, 222b) based on the first solution (232, 232a) 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 (232, 232b).