Skip to content

Commit 15d8622

Browse files
committed
Fix receding horizon CI regressions
1 parent 7b86ef3 commit 15d8622

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

bioptim/optimization/optimal_control_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ def solve(
14151415
self.set_warm_start(sol=warm_start)
14161416

14171417
if self._is_warm_starting:
1418-
if solver.type in (SolverType.IPOPT, SolverType.MADNLP):
1418+
if solver.type == SolverType.IPOPT:
14191419
solver.set_warm_start_options(1e-10)
14201420

14211421
self.ocp_solver.opts = solver

bioptim/optimization/receding_horizon_optimization.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ def solve(
208208
if isinstance(failure_policy, str):
209209
failure_policy = RecedingHorizonFailurePolicy(failure_policy)
210210

211+
for key in self.nlp[0].x_bounds.keys():
212+
if self.nlp[0].x_bounds[key].type not in (
213+
InterpolationType.CONSTANT,
214+
InterpolationType.CONSTANT_WITH_FIRST_AND_LAST_DIFFERENT,
215+
):
216+
raise NotImplementedError(
217+
"The MHE is not implemented yet for x_bounds not being "
218+
"CONSTANT or CONSTANT_WITH_FIRST_AND_LAST_DIFFERENT"
219+
)
220+
211221
sol = None
212222
states = []
213223
controls = []
@@ -1072,7 +1082,7 @@ def _initialize_one_cycle(self, dt: Float, states: AnyDict, controls: AnyDict, p
10721082
x_init.add(
10731083
key,
10741084
states[key],
1075-
interpolation=self.nlp[0].x_init.type,
1085+
interpolation=InterpolationType.EACH_FRAME,
10761086
phase=0,
10771087
)
10781088

0 commit comments

Comments
 (0)