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

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

#include <terminal_stage.hpp>

Public Member Functions

 TerminalStage (const std::shared_ptr< CostFunction > &cost, const std::shared_ptr< Constraints > &constraints, const std::shared_ptr< ContactSequence > &contact_sequence)
 Constructs the impact stage. More...
 
 TerminalStage ()
 Default constructor.
More...
 
 ~TerminalStage ()=default
 Default destructor. More...
 
 TerminalStage (const TerminalStage &)=default
 Default copy constructor. More...
 
TerminalStageoperator= (const TerminalStage &)=default
 Default copy assign operator. More...
 
 TerminalStage (TerminalStage &&) noexcept=default
 Default move constructor. More...
 
TerminalStageoperator= (TerminalStage &&) 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 under 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, 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, 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, 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

Terminal stage computations for optimal control problems.

Constructor & Destructor Documentation

◆ TerminalStage() [1/4]

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

Constructs the impact stage.

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

◆ TerminalStage() [2/4]

robotoc::TerminalStage::TerminalStage ( )

Default constructor.

◆ ~TerminalStage()

robotoc::TerminalStage::~TerminalStage ( )
default

Default destructor.

◆ TerminalStage() [3/4]

robotoc::TerminalStage::TerminalStage ( const TerminalStage )
default

Default copy constructor.

◆ TerminalStage() [4/4]

robotoc::TerminalStage::TerminalStage ( TerminalStage &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ createData()

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

Creates the data.

Parameters
[in]robotRobot model.

◆ evalKKT()

void robotoc::TerminalStage::evalKKT ( Robot robot,
const GridInfo grid_info,
const Eigen::VectorXd &  q_prev,
const SplitSolution s,
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,out]dataData of this stage.
[in,out]kkt_matrixKKT matrix of this stage.
[in,out]kkt_residualKKT residual of this stage.

◆ evalOCP()

void robotoc::TerminalStage::evalOCP ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
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,out]dataData of this stage.
[in,out]kkt_residualKKT residual of this stage.

◆ expandDual()

void robotoc::TerminalStage::expandDual ( const GridInfo grid_info,
OCPData data,
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,out]dSplit direction of this stage.

◆ expandPrimal()

void robotoc::TerminalStage::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::TerminalStage::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,out]robotRobot model.
[in]grid_infoGrid info of this stage.
[in]sSplit solution of this stage.
[in,out]dataData of this stage.

◆ isFeasible()

bool robotoc::TerminalStage::isFeasible ( Robot robot,
const GridInfo grid_info,
const SplitSolution s,
OCPData 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::TerminalStage::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::TerminalStage::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]

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

Default copy assign operator.

◆ operator=() [2/2]

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

Default move assign operator.

◆ updateDual()

void robotoc::TerminalStage::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::TerminalStage::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: