- 3.0.2 optimal control module.
|
Time Keeper Class for Model Predictive Control. More...
#include <MpcTimeKeeper.h>
Public Member Functions | |
MpcTimeKeeper () | |
Standard Constructor MpcTimeKeeper. More... | |
MpcTimeKeeper (std::shared_ptr< MpcTimeHorizon< SCALAR >> timeHorizonStrategy, const mpc_settings &mpc_settings) | |
Constructor for Mpc Time Keeper class. More... | |
void | initialize () |
initialize the Mpc Time Keeper (mandatory) More... | |
void | computeNewTimings (const SCALAR externalTime, const SCALAR current_T, SCALAR &new_T, SCALAR &t_forw_start, SCALAR &t_forw_stop) |
compute new mpc timings, based on current time horizon and the given time horizon strategy More... | |
const bool | finalPointReached () const |
query this in order to find out if the final time horizon has been reached. More... | |
void | updateSettings (const mpc_settings &settings) |
update mpc settings More... | |
void | startDelayMeasurement (const SCALAR &externalTime) |
start measuring time elapsed during planning / solving the optimal control problem More... | |
void | stopDelayMeasurement (const SCALAR &externalTime) |
stop measuring time elapsed during solving the optimal control problem More... | |
SCALAR | timeSincePreviousSuccessfulSolve (const SCALAR &externalTime) |
retrieve the time that elapsed since the last successful solve() call to an Optimal Control Problem More... | |
const SCALAR | timeSinceFirstSuccessfulSolve (const SCALAR &externalTime) |
retrieve the time that elapsed since the first successful solve() call to an Optimal Control Problem More... | |
const SCALAR & | getMeasuredDelay () const |
obtain the delay which was measured during solving the optimal control problem More... | |
const SCALAR & | getMaxMeasuredDelay () const |
get the maximum measured delay (maximum over all cycles) More... | |
const SCALAR & | getMinMeasuredDelay () const |
get the smallest measured delay (minimum over all cycles) More... | |
const SCALAR & | getSummedDelay () const |
get the sum of all measured delays More... | |
Time Keeper Class for Model Predictive Control.
|
inline |
Standard Constructor MpcTimeKeeper.
this constructor should not be used by the normal user. Todo: get rid of MpcTimeKeeper default constructor
|
inline |
Constructor for Mpc Time Keeper class.
timeHorizonStrategy | the user-specified time horizon strategy, for example fixed time horizon |
mpc_settings | the mpc_settings as specified by the user |
|
inline |
initialize the Mpc Time Keeper (mandatory)
resets the TimeKeeper, needs to be called whenever MPC starts over from the beginning.
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::prepareIteration(), and ct::optcon::MPC< OPTCON_SOLVER >::resetMpc().
|
inline |
compute new mpc timings, based on current time horizon and the given time horizon strategy
externalTime | the external timing, optional. |
current_T | the currently active problem time horizon |
new_T | the new, updated problem time horizon, which gets computed by the time horizon strategy |
t_forw_start | time where to start the forward propagation of the state measurement based on delays |
t_forw_stop | time where to stop the forward propagation of the state measurement based on delays |
estimate the delay from planning, etc.
check for compliance of t_forward_stop and t_forward_start with time horizon of the current controller
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::prepareIteration().
|
inline |
query this in order to find out if the final time horizon has been reached.
May be used to trigger corresponding events, such as stopping the control loop.
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::timeHorizonReached().
|
inline |
update mpc settings
settings | the new settings to be handed over |
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::updateSettings().
|
inline |
start measuring time elapsed during planning / solving the optimal control problem
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::finishIteration().
|
inline |
stop measuring time elapsed during solving the optimal control problem
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::finishIteration().
|
inline |
retrieve the time that elapsed since the last successful solve() call to an Optimal Control Problem
the returned time can be used to synchronize the calls to optimal control problems
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::finishIteration().
|
inline |
retrieve the time that elapsed since the first successful solve() call to an Optimal Control Problem
the returned time can be used externally, for example to update cost functions
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::timeSinceFirstSuccessfulSolve().
|
inline |
obtain the delay which was measured during solving the optimal control problem
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::finishIteration().
|
inline |
get the maximum measured delay (maximum over all cycles)
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::printMpcSummary().
|
inline |
get the smallest measured delay (minimum over all cycles)
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::printMpcSummary().
|
inline |
get the sum of all measured delays
Referenced by ct::optcon::MPC< OPTCON_SOLVER >::printMpcSummary().