optimizers
convert_socp_to_cvxopt_format(c, socp_constraints)
socp_constraints = [(Nameₖ, (Aₖ, bfbₖ, bfcₖ, dₖ), ...]
min_u cᵀu s.t. dₖ + bfcₖ u ≻ |Aₖ u + bfbₖ|₂
min cᵀu s.t Gₖ x + sₖ = hₖ, k = 0, ..., M A x = b h₀ - G₀ x ⪰ 0 # Component wise inequalities hₖ[0] - Gₖ[0, :] x ⪰ | hₖ[1:] - Gₖ[1:, :] x |₂, k = 1, ..., M
Source code in bayes_cbf/optimizers.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
optimizer_socp_cvxopt(u0, linear_objective, socp_constraints)
Solve the optimization problem
min_u A u + b s.t. h₀ - (G u)₀ ≻ |h₁ - (Gu)₁ |₂
u0: reference control signal linear_objective: (
convert to cvxopt format and pass to cvxopt
min cᵀu s.t Gₖ x + sₖ = hₖ, k = 0, ..., M A x = b s₀ ⪰ 0 # Component wise inequalities sₖ₀ ⪰ | sₖ₁ |₂, k = 1, ..., M
min cᵀu s.t Gₖ x + sₖ = hₖ, k = 0, ..., M A x = b h₀ - G₀ x ⪰ 0 # Component wise inequalities hₖ[0] - Gₖ[0, :] x ⪰ | hₖ[1:] - Gₖ[1:, :] x |₂, k = 1, ..., M
Source code in bayes_cbf/optimizers.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|