|
robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
The intermediate stage of ParNMPC for unconstrained rigid-body systems. More...
#include <parnmpc_intermediate_stage.hpp>
Public Member Functions | |
| ParNMPCIntermediateStage (const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints) | |
| Constructs the intermediate stage. More... | |
| ParNMPCIntermediateStage () | |
| Default constructor. More... | |
| ~ParNMPCIntermediateStage ()=default | |
| Default destructor. More... | |
| ParNMPCIntermediateStage (const ParNMPCIntermediateStage &)=default | |
| Default copy constructor. More... | |
| ParNMPCIntermediateStage & | operator= (const ParNMPCIntermediateStage &)=default |
| Default copy assign operator. More... | |
| ParNMPCIntermediateStage (ParNMPCIntermediateStage &&) noexcept=default | |
| Default move constructor. More... | |
| ParNMPCIntermediateStage & | operator= (ParNMPCIntermediateStage &&) 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 Eigen::VectorXd &q_prev, const Eigen::VectorXd &v_prev, 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 Eigen::VectorXd &q_prev, const Eigen::VectorXd &v_prev, const SplitSolution &s, const SplitSolution &s_next, UnconstrOCPData &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual) const |
| Computes the KKT matrix and residual of this stage. More... | |
| void | expandPrimalAndDual (const double dt, const SplitKKTMatrix &kkt_matrix, const SplitKKTResidual &kkt_residual, 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... | |
The intermediate stage of ParNMPC for unconstrained rigid-body systems.
| robotoc::ParNMPCIntermediateStage::ParNMPCIntermediateStage | ( | const Robot & | robot, |
| const std::shared_ptr< CostFunction > & | cost, | ||
| const std::shared_ptr< Constraints > & | constraints | ||
| ) |
Constructs the intermediate stage.
| [in] | robot | Robot model. |
| [in] | cost | Shared ptr to the cost function. |
| [in] | constraints | Shared ptr to the constraints. |
| robotoc::ParNMPCIntermediateStage::ParNMPCIntermediateStage | ( | ) |
Default constructor.
|
default |
Default destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
| UnconstrOCPData robotoc::ParNMPCIntermediateStage::createData | ( | const Robot & | robot | ) | const |
Creates the data.
| [in] | robot | Robot model. |
| void robotoc::ParNMPCIntermediateStage::evalKKT | ( | Robot & | robot, |
| const GridInfo & | grid_info, | ||
| const Eigen::VectorXd & | q_prev, | ||
| const Eigen::VectorXd & | v_prev, | ||
| const SplitSolution & | s, | ||
| const SplitSolution & | s_next, | ||
| 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] | q_prev | Configuration at the previous stage. |
| [in] | v_prev | Configuration at the previous stage. |
| [in] | s | Split solution of this stage. |
| [in] | s_next | Split solution of the next 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::ParNMPCIntermediateStage::evalOCP | ( | Robot & | robot, |
| const GridInfo & | grid_info, | ||
| const Eigen::VectorXd & | q_prev, | ||
| const Eigen::VectorXd & | v_prev, | ||
| 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] | q_prev | Configuration at the previous stage. |
| [in] | v_prev | Configuration at the previous stage. |
| [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::ParNMPCIntermediateStage::expandPrimalAndDual | ( | const double | dt, |
| const SplitKKTMatrix & | kkt_matrix, | ||
| const SplitKKTResidual & | kkt_residual, | ||
| 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] | dt | Time step. |
| [in] | kkt_matrix | Split KKT matrix of this stage. |
| [in] | kkt_residual | Split KKT residual of this stage. |
| [in,out] | data | Data of this stage. |
| [in,out] | d | Split direction of this stage. |
| void robotoc::ParNMPCIntermediateStage::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::ParNMPCIntermediateStage::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::ParNMPCIntermediateStage::maxDualStepSize | ( | const UnconstrOCPData & | data | ) | const |
Computes the maximum dual size.
| [in] | data | Data of this stage. |
| double robotoc::ParNMPCIntermediateStage::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::ParNMPCIntermediateStage::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::ParNMPCIntermediateStage::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. |