Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Quadratic Programming with GTSAM

This notebook starts with a small geometric QP, then reproduces the quadrotor allocation QP from timing/timeActiveSetSolverComparison.cpp and visualizes active rotor bounds and wrench residuals with Plotly.

Open In Colab

A 2D QP with equality and active inequality

The unconstrained target lies to the right of the feasible segment. The equality x + y = 1 restricts the solution to a line, and x <= 0.35 becomes active.

target = [0.85 0.55]
solution = [0.35 0.65]
objective = 0.130000
violations: equality=0.00e+00, inequality=0.00e+00
Loading...

Quadrotor allocation QP

This is the same allocation model used in timing/timeActiveSetSolverComparison.cpp: four rotor thrusts are chosen to track a desired wrench while staying inside [0, 1] bounds.

rotor thrusts = [1.         0.89214598 0.99214558 0.51478374]
achieved wrench = [ 3.39907529  0.14630397  0.09630417 -0.01847539]
wrench residual = [-0.00092471 -0.00369603 -0.00369583 -0.01847539]
objective = 1.862801e-04, inequality violation = 0.00e+00
Loading...