Skip to content

Commit 54de2a3

Browse files
committed
allow print_summary to be set in solve_ocp
1 parent 2860d89 commit 54de2a3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

control/optimal.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,8 @@ def __init__(
897897
def solve_ocp(
898898
sys, horizon, X0, cost, trajectory_constraints=None, terminal_cost=None,
899899
terminal_constraints=[], initial_guess=None, basis=None, squeeze=None,
900-
transpose=None, return_states=True, log=False, **kwargs):
900+
transpose=None, return_states=True, print_summary=True, log=False,
901+
**kwargs):
901902

902903
"""Compute the solution to an optimal control problem
903904
@@ -951,6 +952,9 @@ def solve_ocp(
951952
log : bool, optional
952953
If `True`, turn on logging messages (using Python logging module).
953954
955+
print_summary : bool, optional
956+
If `True` (default), print a short summary of the computation.
957+
954958
return_states : bool, optional
955959
If True, return the values of the state at each time (default = True).
956960
@@ -1017,7 +1021,8 @@ def solve_ocp(
10171021

10181022
# Solve for the optimal input from the current state
10191023
return ocp.compute_trajectory(
1020-
X0, squeeze=squeeze, transpose=transpose, return_states=return_states)
1024+
X0, squeeze=squeeze, transpose=transpose, print_summary=print_summary,
1025+
return_states=return_states)
10211026

10221027

10231028
# Create a model predictive controller for an optimal control problem

0 commit comments

Comments
 (0)