- 3.0.2 optimal control module.
ct::optcon::mpc_settings Struct Reference

MPC Settings struct. More...

#include <MpcSettings.h>

Public Member Functions

void print ()
 Print MPC settings to console. More...
 

Public Attributes

bool stateForwardIntegration_ = false
 
ct::core::IntegrationType stateForwardIntegratorType_ = ct::core::IntegrationType::RK4
 
double stateForwardIntegration_dt_ = 0.001
 
bool measureDelay_ = false
 
double delayMeasurementMultiplier_ = 0.7
 
int fixedDelayUs_ = 0
 
int additionalDelayUs_ = 0
 
bool postTruncation_ = false
 
MPC_MODE mpc_mode = CONSTANT_RECEDING_HORIZON
 
core::Time minimumTimeHorizonMpc_ = 1.0
 
bool coldStart_ = false
 
bool useExternalTiming_ = false
 

Detailed Description

MPC Settings struct.

Examples:
NLOC_MPC.cpp.

Member Function Documentation

◆ print()

void ct::optcon::mpc_settings::print ( )
inline

Print MPC settings to console.

Member Data Documentation

◆ stateForwardIntegration_

bool ct::optcon::mpc_settings::stateForwardIntegration_ = false

State prediction. Use state prediction (based on a given delay, the given initial state and a given policy)? If set to true, MPC will either use a measurement of the delay or use the fixed delay given below as "fixedDelayUs_".

Examples:
NLOC_MPC.cpp.

Referenced by ct::optcon::MPC< OPTCON_SOLVER >::doForwardIntegration(), ct::optcon::loadMpcSettings(), main(), and ct::optcon::example::TEST().

◆ stateForwardIntegratorType_

ct::core::IntegrationType ct::optcon::mpc_settings::stateForwardIntegratorType_ = ct::core::IntegrationType::RK4

Integrator type to use for the state prediction

Referenced by ct::optcon::loadMpcSettings(), ct::optcon::example::TEST(), and ct::optcon::MPC< OPTCON_SOLVER >::updateSettings().

◆ stateForwardIntegration_dt_

double ct::optcon::mpc_settings::stateForwardIntegration_dt_ = 0.001

time step size employed for the forward integration

Referenced by ct::optcon::loadMpcSettings(), ct::optcon::MPC< OPTCON_SOLVER >::printMpcSummary(), and ct::optcon::example::TEST().

◆ measureDelay_

bool ct::optcon::mpc_settings::measureDelay_ = false

Delay compensation. If measureDelay_ is set to true, the MPC timer automatically keeps track of the planning times and uses them for the state forward prediction. Only applies if stateForwardIntegration_ is set to true.

Examples:
NLOC_MPC.cpp.

Referenced by ct::optcon::tpl::MpcTimeKeeper< Scalar_t >::getSummedDelay(), ct::optcon::loadMpcSettings(), main(), ct::optcon::MPC< OPTCON_SOLVER >::printMpcSummary(), ct::optcon::tpl::MpcTimeKeeper< Scalar_t >::startDelayMeasurement(), and ct::optcon::example::TEST().

◆ delayMeasurementMultiplier_

double ct::optcon::mpc_settings::delayMeasurementMultiplier_ = 0.7

The delayMeasurementMultiplier_ quantifies the level of trust you have in our planning time measurement. In case you wish to be conservative, for example because the planning times vary a lot, reduce this multiplier. Maximum confidence means, set it to 1.0. In essence, this number says "how much of our measured delay do we use for pre-integration".

Examples:
NLOC_MPC.cpp.

Referenced by ct::optcon::tpl::MpcTimeKeeper< Scalar_t >::getSummedDelay(), ct::optcon::loadMpcSettings(), main(), and ct::optcon::example::TEST().

◆ fixedDelayUs_

int ct::optcon::mpc_settings::fixedDelayUs_ = 0

If not using measureDelay_ = true, we can instead set a fixed, known delay in microseconds (!) here.

Referenced by ct::optcon::tpl::MpcTimeKeeper< Scalar_t >::getSummedDelay(), ct::optcon::loadMpcSettings(), ct::optcon::MPC< OPTCON_SOLVER >::printMpcSummary(), and ct::optcon::example::TEST().

◆ additionalDelayUs_

int ct::optcon::mpc_settings::additionalDelayUs_ = 0

Additional delay in microseconds (!), which gets added to either the measured delay of above fixedDelay.

Referenced by ct::optcon::tpl::MpcTimeKeeper< Scalar_t >::getSummedDelay(), ct::optcon::loadMpcSettings(), and ct::optcon::example::TEST().

◆ postTruncation_

bool ct::optcon::mpc_settings::postTruncation_ = false

If solving the problem takes longer than predicted, we can post-truncate the solution trajectories.

Examples:
NLOC_MPC.cpp.

Referenced by ct::optcon::MPC< OPTCON_SOLVER >::finishIteration(), ct::optcon::loadMpcSettings(), main(), and ct::optcon::example::TEST().

◆ mpc_mode

◆ minimumTimeHorizonMpc_

core::Time ct::optcon::mpc_settings::minimumTimeHorizonMpc_ = 1.0

see description of the different modes above

Referenced by ct::optcon::tpl::MpcTimeHorizon< SCALAR >::computeNewTimeHorizon(), and ct::optcon::loadMpcSettings().

◆ coldStart_

bool ct::optcon::mpc_settings::coldStart_ = false

cold starting or warm starting. Warm starting will either use a default strategy for common controller types, or a user specified custom warm starting strategy.

Examples:
NLOC_MPC.cpp.

Referenced by ct::optcon::loadMpcSettings(), main(), ct::optcon::MPC< OPTCON_SOLVER >::MPC(), and ct::optcon::example::TEST().

◆ useExternalTiming_


The documentation for this struct was generated from the following file: