Skip to content

Commit 6fcdf77

Browse files
fix: update optimal_control_interface.jl to new semantics
1 parent 8366897 commit 6fcdf77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/systems/optimal_control_interface.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function InfiniteOptDynamicOptProblem end
2121
function CasADiDynamicOptProblem end
2222

2323
function warn_overdetermined(sys, u0map)
24-
constraintsys = get_constraintsystem(sys)
25-
if !isnothing(constraintsys)
26-
(length(constraints(constraintsys)) + length(u0map) > length(unknowns(sys))) &&
24+
cstrs = constraints(sys)
25+
if !isempty(cstrs)
26+
(length(cstrs) + length(u0map) > length(unknowns(sys))) &&
2727
@warn "The control problem is overdetermined. The total number of conditions (# constraints + # fixed initial values given by u0map) exceeds the total number of states. The solvers will default to doing a nonlinear least-squares optimization."
2828
end
2929
end

0 commit comments

Comments
 (0)