robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::UnconstrIntermediateStage Class Reference

The intermediate stage of OCP computation for unconstrained rigid-body systems. More...

#include <unconstr_intermediate_stage.hpp>

Public Member Functions

 UnconstrIntermediateStage (const Robot &robot, const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints)
 Constructs a split optimal control problem. More...
 
 UnconstrIntermediateStage ()
 Default constructor.
More...
 
 ~UnconstrIntermediateStage ()=default
 Default destructor. More...
 
 UnconstrIntermediateStage (const UnconstrIntermediateStage &)=default
 Default copy constructor. More...
 
UnconstrIntermediateStageoperator= (const UnconstrIntermediateStage &)=default
 Default copy assign operator. More...
 
 UnconstrIntermediateStage (UnconstrIntermediateStage &&) noexcept=default
 Default move constructor. More...
 
UnconstrIntermediateStageoperator= (UnconstrIntermediateStage &&) 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 under 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, const SplitSolution &s_next, 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, 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...
 

Detailed Description

The intermediate stage of OCP computation for unconstrained rigid-body systems.

The terminal stage of OCP computation for unconstrained rigid-body systems.

Constructor & Destructor Documentation

◆ UnconstrIntermediateStage() [1/4]

robotoc::UnconstrIntermediateStage::UnconstrIntermediateStage ( const Robot robot,
const std::shared_ptr< CostFunction > &  cost,
const std::shared_ptr< Constraints > &  constraints 
)

Constructs a split optimal control problem.

Parameters
[in]robotRobot model.
[in]costShared ptr to the cost function.
[in]constraintsShared ptr to the constraints.

◆ UnconstrIntermediateStage() [2/4]

robotoc::UnconstrIntermediateStage::UnconstrIntermediateStage ( )

Default constructor.

◆ ~UnconstrIntermediateStage()

robotoc::UnconstrIntermediateStage::~UnconstrIntermediateStage ( )
default

Default destructor.

◆ UnconstrIntermediateStage() [3/4]

robotoc::UnconstrIntermediateStage::UnconstrIntermediateStage ( const UnconstrIntermediateStage )
default

Default copy constructor.

◆ UnconstrIntermediateStage() [4/4]

robotoc::UnconstrIntermediateStage::UnconstrIntermediateStage ( UnconstrIntermediateStage &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ createData()

UnconstrOCPData robotoc::UnconstrIntermediateStage::createData ( const Robot robot) const

Creates the data.

Parameters
[in]robotRobot model.

◆ evalKKT()

void robotoc::UnconstrIntermediateStage::evalKKT ( Robot robot,
const GridInfo grid_info,
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.

Parameters
[in,out]robotRobot model.
[in]grid_infoGrid info.
[in]sSplit solution of this stage.
[in]s_nextSplit solution of the next stage.
[in,out]dataData of this stage.
[in,out]kkt_matrixSplit KKT matrix of this stage.
[in,out]kkt_residualSplit KKT residual of this stage.

◆ evalOCP()

void robotoc::UnconstrIntermediateStage::evalOCP ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
const SplitSolution s_next,
UnconstrOCPData data,
SplitKKTResidual kkt_residual 
) const

Computes the stage cost and constraint violation of this stage.

Parameters
[in,out]robotRobot model.
[in]grid_infoGrid info.
[in]sSplit solution of this stage.
[in]s_nextSplit solution of the next stage.
[in,out]dataData of this stage.
[in,out]kkt_residualSplit KKT residual of this stage.

◆ expandPrimalAndDual()

void robotoc::UnconstrIntermediateStage::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.

Parameters
[in]dtTime step.
[in]kkt_matrixSplit KKT matrix of this stage.
[in]kkt_residualSplit KKT residual of this stage.
[in,out]dataData of this stage.
[in,out]dSplit direction of this stage.

◆ initConstraints()

void robotoc::UnconstrIntermediateStage::initConstraints ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
UnconstrOCPData data 
) const

Initializes the constraints, i.e., set slack and dual variables.

Parameters
[in,out]robotRobot model.
[in]grid_infoGrid info.
[in]sSplit solution of this stage.
[in,out]dataData of this stage.

◆ isFeasible()

bool robotoc::UnconstrIntermediateStage::isFeasible ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
UnconstrOCPData data 
) const

Checks whether the solution is feasible under inequality constraints.

Parameters
[in,out]robotRobot model.
[in]grid_infoGrid info of this stage.
[in]sSplit solution of this stage.
[in,out]dataData of this stage.

◆ maxDualStepSize()

double robotoc::UnconstrIntermediateStage::maxDualStepSize ( const UnconstrOCPData data) const

Computes the maximum dual size.

Parameters
[in]dataData of this stage.
Returns
Maximum dual step size.

◆ maxPrimalStepSize()

double robotoc::UnconstrIntermediateStage::maxPrimalStepSize ( const UnconstrOCPData data) const

Computes the maximum primal step size.

Parameters
[in]dataData of this stage.
Returns
Maximum primal step size.

◆ operator=() [1/2]

UnconstrIntermediateStage & robotoc::UnconstrIntermediateStage::operator= ( const UnconstrIntermediateStage )
default

Default copy assign operator.

◆ operator=() [2/2]

UnconstrIntermediateStage & robotoc::UnconstrIntermediateStage::operator= ( UnconstrIntermediateStage &&  )
defaultnoexcept

Default move assign operator.

◆ updateDual()

void robotoc::UnconstrIntermediateStage::updateDual ( const double  dual_step_size,
UnconstrOCPData data 
) const

Updates dual variables of the inequality constraints.

Parameters
[in]dual_step_sizeDula step size.
[in,out]dataData of this stage.

◆ updatePrimal()

void robotoc::UnconstrIntermediateStage::updatePrimal ( const Robot robot,
const double  primal_step_size,
const SplitDirection d,
SplitSolution s,
UnconstrOCPData data 
) const

Updates primal variables of this stage.

Parameters
[in]robotRobot model.
[in]primal_step_sizePrimal step size.
[in]dSplit direction of this stage.
[in,out]sSplit solution of this stage.
[in,out]dataData of this stage.

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