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

Intermediate stage computations for optimal control problems. More...

#include <intermediate_stage.hpp>

Public Member Functions

 IntermediateStage (const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints, const std::shared_ptr< ContactSequence > &contact_sequence)
 Constructs the intermediate stage. More...
 
 IntermediateStage ()
 Default constructor.
More...
 
 ~IntermediateStage ()=default
 Default destructor. More...
 
 IntermediateStage (const IntermediateStage &)=default
 Default copy constructor. More...
 
IntermediateStageoperator= (const IntermediateStage &)=default
 Default copy assign operator. More...
 
 IntermediateStage (IntermediateStage &&) noexcept=default
 Default move constructor. More...
 
IntermediateStageoperator= (IntermediateStage &&) noexcept=default
 Default move assign operator. More...
 
OCPData createData (const Robot &robot) const
 Creates the data. More...
 
bool isFeasible (Robot &robot, const GridInfo &grid_info, const SplitSolution &s, OCPData &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, OCPData &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, OCPData &data, SplitKKTResidual &kkt_residual) const
 Computes the stage cost and constraint violation. More...
 
void evalKKT (Robot &robot, const GridInfo &grid_info, const Eigen::VectorXd &q_prev, const SplitSolution &s, const SplitSolution &s_next, OCPData &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual) const
 Computes the KKT residual and matrix of this stage. More...
 
void expandPrimal (const GridInfo &grid_info, OCPData &data, SplitDirection &d) const
 Expands the condensed primal variables, i.e., computes the Newton direction of the condensed primal variables of this stage. More...
 
void expandDual (const GridInfo &grid_info, OCPData &data, const SplitDirection &d_next, SplitDirection &d) const
 Expands the condensed dual variables, i.e., computes the Newton direction of the condensed dual variables of this stage. More...
 
double maxPrimalStepSize (const OCPData &data) const
 Returns maximum stap size of the primal variables that satisfies the inequality constraints. More...
 
double maxDualStepSize (const OCPData &data) const
 Returns maximum stap size of the dual variables that satisfies the inequality constraints. More...
 
void updatePrimal (const Robot &robot, const double primal_step_size, const SplitDirection &d, SplitSolution &s, OCPData &data) const
 Updates primal variables of this stage. More...
 
void updateDual (const double dual_step_size, OCPData &data) const
 Updates dual variables of this stage. More...
 

Detailed Description

Intermediate stage computations for optimal control problems.

Constructor & Destructor Documentation

◆ IntermediateStage() [1/4]

robotoc::IntermediateStage::IntermediateStage ( const std::shared_ptr< CostFunction > &  cost,
const std::shared_ptr< Constraints > &  constraints,
const std::shared_ptr< ContactSequence > &  contact_sequence 
)

Constructs the intermediate stage.

Parameters
[in]costShared ptr to the cost function.
[in]constraintsShared ptr to the constraints.
[in]contact_sequenceShared ptr to the contact sequence.

◆ IntermediateStage() [2/4]

robotoc::IntermediateStage::IntermediateStage ( )

Default constructor.

◆ ~IntermediateStage()

robotoc::IntermediateStage::~IntermediateStage ( )
default

Default destructor.

◆ IntermediateStage() [3/4]

robotoc::IntermediateStage::IntermediateStage ( const IntermediateStage )
default

Default copy constructor.

◆ IntermediateStage() [4/4]

robotoc::IntermediateStage::IntermediateStage ( IntermediateStage &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ createData()

OCPData robotoc::IntermediateStage::createData ( const Robot robot) const

Creates the data.

Parameters
[in]robotRobot model.

◆ evalKKT()

void robotoc::IntermediateStage::evalKKT ( Robot robot,
const GridInfo grid_info,
const Eigen::VectorXd &  q_prev,
const SplitSolution s,
const SplitSolution s_next,
OCPData data,
SplitKKTMatrix kkt_matrix,
SplitKKTResidual kkt_residual 
) const

Computes the KKT residual and matrix of this stage.

Parameters
[in,out]robotRobot model.
[in]grid_infoGrid info of this stage.
[in]q_prevConfiguration at the previous stage.
[in]sSplit solution of this stage.
[in]s_nextSplit solution of the next stage.
[in,out]dataData of this stage.
[in,out]kkt_matrixKKT matrix of this stage.
[in,out]kkt_residualKKT residual of this stage.

◆ evalOCP()

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

Computes the stage cost and constraint violation.

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

◆ expandDual()

void robotoc::IntermediateStage::expandDual ( const GridInfo grid_info,
OCPData data,
const SplitDirection d_next,
SplitDirection d 
) const

Expands the condensed dual variables, i.e., computes the Newton direction of the condensed dual variables of this stage.

Parameters
[in]grid_infoGrid info of this stage.
[in,out]dataData of this stage.
[in]d_nextSplit direction of the next stage.
[in,out]dSplit direction of this stage.

◆ expandPrimal()

void robotoc::IntermediateStage::expandPrimal ( const GridInfo grid_info,
OCPData data,
SplitDirection d 
) const

Expands the condensed primal variables, i.e., computes the Newton direction of the condensed primal variables of this stage.

Parameters
[in]grid_infoGrid info of this stage.
[in,out]dataData of this stage.
[in,out]dSplit direction of this stage.

◆ initConstraints()

void robotoc::IntermediateStage::initConstraints ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
OCPData data 
) const

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

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

◆ isFeasible()

bool robotoc::IntermediateStage::isFeasible ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
OCPData data 
) const

Checks whether the solution is feasible w.r.t. the 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::IntermediateStage::maxDualStepSize ( const OCPData data) const

Returns maximum stap size of the dual variables that satisfies the inequality constraints.

Parameters
[in]dataData of this stage.
Returns
Maximum stap size of the dual variables that satisfies the inequality constraints.

◆ maxPrimalStepSize()

double robotoc::IntermediateStage::maxPrimalStepSize ( const OCPData data) const

Returns maximum stap size of the primal variables that satisfies the inequality constraints.

Parameters
[in]dataData of this stage.
Returns
Maximum stap size of the primal variables that satisfies the inequality constraints.

◆ operator=() [1/2]

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

Default copy assign operator.

◆ operator=() [2/2]

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

Default move assign operator.

◆ updateDual()

void robotoc::IntermediateStage::updateDual ( const double  dual_step_size,
OCPData data 
) const

Updates dual variables of this stage.

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

◆ updatePrimal()

void robotoc::IntermediateStage::updatePrimal ( const Robot robot,
const double  primal_step_size,
const SplitDirection d,
SplitSolution s,
OCPData 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: