Skip to content

Commit 3f135f1

Browse files
committed
Add regularization to square root bp
1 parent 6cff460 commit 3f135f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/solvers/ilqr/backward_pass.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ function _backwardpass_sqrt!(prob::Problem,solver::iLQRSolver)
126126
end
127127

128128
#TODO regularization scheme
129+
if cond(Quu_reg) > 1e8
130+
regularization_update!(solver,:increase)
131+
132+
# reset backward pass
133+
k = N-1
134+
ΔV[1] = 0.
135+
ΔV[2] = 0.
136+
continue
137+
end
138+
129139

130140
# Compute gains
131141
K[k] = -Quu_reg\(Quu_reg'\Qux_reg)

0 commit comments

Comments
 (0)