robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
#include <unconstr_terminal_stage.hpp>
Public Member Functions | |
UnconstrTerminalStage (const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints) | |
Constructs a split optimal control problem. More... | |
UnconstrTerminalStage () | |
Default constructor. More... | |
~UnconstrTerminalStage ()=default | |
Default destructor. More... | |
UnconstrTerminalStage (const UnconstrTerminalStage &)=default | |
Default copy constructor. More... | |
UnconstrTerminalStage & | operator= (const UnconstrTerminalStage &)=default |
Default copy assign operator. More... | |
UnconstrTerminalStage (UnconstrTerminalStage &&) noexcept=default | |
Default move constructor. More... | |
UnconstrTerminalStage & | operator= (UnconstrTerminalStage &&) noexcept=default |
Default move assign operator. More... | |
UnconstrOCPData | createData (const Robot &robot) const |
Creates the data. More... | |
bool | isFeasible (Robot &robot, const GridInfo &grid_info, const SplitSolution &s, UnconstrOCPData &data) const |
Checks whether the solution is feasible w.r.t. the inequality constraints. More... | |
void | initConstraints (Robot &robot, const GridInfo &grid_info, const SplitSolution &s, UnconstrOCPData &data) const |
Initializes the constraints, i.e., set slack and dual variables. More... | |
void | evalOCP (Robot &robot, const GridInfo &grid_info, const SplitSolution &s, UnconstrOCPData &data, SplitKKTResidual &kkt_residual) const |
Computes the stage cost and constraint violation of this stage. More... | |
void | evalKKT (Robot &robot, const GridInfo &grid_info, const SplitSolution &s, UnconstrOCPData &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual) const |
Computes the KKT matrix and residual of this stage. More... | |
void | expandPrimalAndDual (UnconstrOCPData &data, SplitDirection &d) const |
Expands the primal and dual variables, i.e., computes the Newton direction of the condensed variables of this stage. More... | |
double | maxPrimalStepSize (const UnconstrOCPData &data) const |
Computes the maximum primal step size. More... | |
double | maxDualStepSize (const UnconstrOCPData &data) const |
Computes the maximum dual size. More... | |
void | updatePrimal (const Robot &robot, const double primal_step_size, const SplitDirection &d, SplitSolution &s, UnconstrOCPData &data) const |
Updates primal variables of this stage. More... | |
void | updateDual (const double dual_step_size, UnconstrOCPData &data) const |
Updates dual variables of the inequality constraints. More... | |
robotoc::UnconstrTerminalStage::UnconstrTerminalStage | ( | const Robot & | robot, |
const std::shared_ptr< CostFunction > & | cost, | ||
const std::shared_ptr< Constraints > & | constraints | ||
) |
Constructs a split optimal control problem.
[in] | robot | Robot model. |
[in] | cost | Shared ptr to the cost function. |
[in] | constraints | Shared ptr to the constraints. |
robotoc::UnconstrTerminalStage::UnconstrTerminalStage | ( | ) |
Default constructor.
|
default |
Default destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
UnconstrOCPData robotoc::UnconstrTerminalStage::createData | ( | const Robot & | robot | ) | const |
Creates the data.
[in] | robot | Robot model. |
void robotoc::UnconstrTerminalStage::evalKKT | ( | Robot & | robot, |
const GridInfo & | grid_info, | ||
const SplitSolution & | s, | ||
UnconstrOCPData & | data, | ||
SplitKKTMatrix & | kkt_matrix, | ||
SplitKKTResidual & | kkt_residual | ||
) | const |
Computes the KKT matrix and residual of this stage.
[in,out] | robot | Robot model. |
[in] | grid_info | Grid info. |
[in] | s | Split solution of this stage. |
[in,out] | data | Data of this stage. |
[in,out] | kkt_matrix | Split KKT matrix of this stage. |
[in,out] | kkt_residual | Split KKT residual of this stage. |
void robotoc::UnconstrTerminalStage::evalOCP | ( | Robot & | robot, |
const GridInfo & | grid_info, | ||
const SplitSolution & | s, | ||
UnconstrOCPData & | data, | ||
SplitKKTResidual & | kkt_residual | ||
) | const |
Computes the stage cost and constraint violation of this stage.
[in,out] | robot | Robot model. |
[in] | grid_info | Grid info. |
[in] | s | Split solution of this stage. |
[in,out] | data | Data of this stage. |
[in,out] | kkt_residual | Split KKT residual of this stage. |
void robotoc::UnconstrTerminalStage::expandPrimalAndDual | ( | UnconstrOCPData & | data, |
SplitDirection & | d | ||
) | const |
Expands the primal and dual variables, i.e., computes the Newton direction of the condensed variables of this stage.
[in,out] | data | Data of this stage. |
[in,out] | d | Split direction of this stage. |
void robotoc::UnconstrTerminalStage::initConstraints | ( | Robot & | robot, |
const GridInfo & | grid_info, | ||
const SplitSolution & | s, | ||
UnconstrOCPData & | data | ||
) | const |
Initializes the constraints, i.e., set slack and dual variables.
[in,out] | robot | Robot model. |
[in] | grid_info | Grid info. |
[in] | s | Split solution of this stage. |
[in,out] | data | Data of this stage. |
bool robotoc::UnconstrTerminalStage::isFeasible | ( | Robot & | robot, |
const GridInfo & | grid_info, | ||
const SplitSolution & | s, | ||
UnconstrOCPData & | data | ||
) | const |
Checks whether the solution is feasible w.r.t. the inequality constraints.
[in,out] | robot | Robot model. |
[in] | grid_info | Grid info of this stage. |
[in] | s | Split solution of this stage. |
[in,out] | data | Data of this stage. |
double robotoc::UnconstrTerminalStage::maxDualStepSize | ( | const UnconstrOCPData & | data | ) | const |
Computes the maximum dual size.
[in] | data | Data of this stage. |
double robotoc::UnconstrTerminalStage::maxPrimalStepSize | ( | const UnconstrOCPData & | data | ) | const |
Computes the maximum primal step size.
[in] | data | Data of this stage. |
|
default |
Default copy assign operator.
|
defaultnoexcept |
Default move assign operator.
void robotoc::UnconstrTerminalStage::updateDual | ( | const double | dual_step_size, |
UnconstrOCPData & | data | ||
) | const |
Updates dual variables of the inequality constraints.
[in] | dual_step_size | Dula step size. |
[in,out] | data | Data of this stage. |
void robotoc::UnconstrTerminalStage::updatePrimal | ( | const Robot & | robot, |
const double | primal_step_size, | ||
const SplitDirection & | d, | ||
SplitSolution & | s, | ||
UnconstrOCPData & | data | ||
) | const |
Updates primal variables of this stage.
[in] | robot | Robot model. |
[in] | primal_step_size | Primal step size. |
[in] | d | Split direction of this stage. |
[in,out] | s | Split solution of this stage. |
[in,out] | data | Data of this stage. |