Skip to content

Commit

Permalink
feature: Weighting matrices from the Elhesasy paper achieve improveme…
Browse files Browse the repository at this point in the history
…nt in steady state accuracy of MPC. It is close to PID

Some random samples:
x +00.10, y +00.12, z +00.80 ——— velocity -00.02, +00.00, +00.00

x +00.10, y +00.11, z +00.80 ——— velocity +00.01, -00.04, -00.00

x +00.10, y +00.11, z +00.80 ——— velocity +00.00, -00.04, +00.00
  • Loading branch information
hedaniel7 committed Feb 16, 2024
1 parent b2f9c9d commit 1f85a32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gym_pybullet_drones/control/MPCCasADiControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ def __init__(self,
J = 0 # Objective function
g = [] # constraints vector

# Q=diag(MX([100, 100, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0]))
'''# Q=diag(MX([100, 100, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0]))
Q = diagcat(100, 100, 100, 1, 1, 1, 1, 1, 1, 1, 1, 1)
# R=diag(MX([10.0, 10.0, 10.0, 10.0]))
R = diagcat(10.0, 10.0, 10.0, 10.0)
R = diagcat(10.0, 10.0, 10.0, 10.0)'''

Q = diagcat(1, 1, 1, 0.6, 0.6, 1, 0, 0, 0, 0, 0, 0)
R = diagcat(0.3, 0.3, 0.3, 0.8)

x_init = P[0:Nx]
g = X[:, 0] - P[0:Nx] # initial condition constraints
Expand Down

0 comments on commit 1f85a32

Please sign in to comment.