robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::CostFunctionComponentBase Class Referenceabstract

Base class of components of cost function. More...

#include <cost_function_component_base.hpp>

Inheritance diagram for robotoc::CostFunctionComponentBase:
Collaboration diagram for robotoc::CostFunctionComponentBase:

Public Member Functions

 CostFunctionComponentBase ()
 Default constructor. More...
 
virtual ~CostFunctionComponentBase ()
 Destructor. More...
 
 CostFunctionComponentBase (const CostFunctionComponentBase &)=default
 Default copy constructor. More...
 
CostFunctionComponentBaseoperator= (const CostFunctionComponentBase &)=default
 Default copy operator. More...
 
 CostFunctionComponentBase (CostFunctionComponentBase &&) noexcept=default
 Default move constructor. More...
 
CostFunctionComponentBaseoperator= (CostFunctionComponentBase &&) noexcept=default
 Default move assign operator. More...
 
virtual double evalStageCost (Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const =0
 Computes the stage cost. More...
 
virtual void evalStageCostDerivatives (Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTResidual &kkt_residual) const =0
 Computes the first-order partial derivatives of the stage cost. This function is always called just after evalStageCost(). More...
 
virtual void evalStageCostHessian (Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTMatrix &kkt_matrix) const =0
 Computes the Hessian, i.e., the second-order partial derivatives of the stage cost. This function is always called just after evalStageCostDerivatives(). More...
 
virtual double evalTerminalCost (Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const =0
 Computes the terminal cost. More...
 
virtual void evalTerminalCostDerivatives (Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTResidual &kkt_residual) const =0
 Computes the first-order partial derivatives of the terminal cost. This function is always called just after evalTerminalCost(). More...
 
virtual void evalTerminalCostHessian (Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTMatrix &kkt_matrix) const =0
 Computes the Hessian, i.e., the second-order partial derivatives of the teminal cost. This function is always called just after evalTerminalCostDerivatives(). More...
 
virtual double evalImpactCost (Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const =0
 Computes the impact cost. More...
 
virtual void evalImpactCostDerivatives (Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTResidual &kkt_residual) const =0
 Computes the first-order partial derivatives of the impact cost. This function is always called just after evalImpactCost(). More...
 
virtual void evalImpactCostHessian (Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTMatrix &kkt_matrix) const =0
 Computes the Hessian, i.e., the second-order partial derivatives of the impact cost. This function is always called just after evalImpactCostDerivatives(). More...
 
template<typename Derived >
std::shared_ptr< Derived > as_shared_ptr ()
 Gets the shared ptr of this object as the specified type. If this fails in dynamic casting, throws an exception. More...
 

Detailed Description

Base class of components of cost function.

Constructor & Destructor Documentation

◆ CostFunctionComponentBase() [1/3]

robotoc::CostFunctionComponentBase::CostFunctionComponentBase ( )
inline

Default constructor.

◆ ~CostFunctionComponentBase()

virtual robotoc::CostFunctionComponentBase::~CostFunctionComponentBase ( )
inlinevirtual

Destructor.

◆ CostFunctionComponentBase() [2/3]

robotoc::CostFunctionComponentBase::CostFunctionComponentBase ( const CostFunctionComponentBase )
default

Default copy constructor.

◆ CostFunctionComponentBase() [3/3]

robotoc::CostFunctionComponentBase::CostFunctionComponentBase ( CostFunctionComponentBase &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ as_shared_ptr()

template<typename Derived >
std::shared_ptr< Derived > robotoc::CostFunctionComponentBase::as_shared_ptr ( )
inline

Gets the shared ptr of this object as the specified type. If this fails in dynamic casting, throws an exception.

Template Parameters
DerivedThe derived type.
Returns
shared ptr of this object as the specified type.

◆ evalImpactCost()

virtual double robotoc::CostFunctionComponentBase::evalImpactCost ( Robot robot,
const ImpactStatus impact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s 
) const
pure virtual

Computes the impact cost.

Parameters
[in]robotRobot model.
[in]impact_statusImpact status.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
Returns
Impact cost.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalImpactCostDerivatives()

virtual void robotoc::CostFunctionComponentBase::evalImpactCostDerivatives ( Robot robot,
const ImpactStatus impact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTResidual kkt_residual 
) const
pure virtual

Computes the first-order partial derivatives of the impact cost. This function is always called just after evalImpactCost().

Parameters
[in]robotRobot model.
[in]impact_statusImpact status.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
[in,out]kkt_residualSplit KKT residual. The partial derivatives are added to this object.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalImpactCostHessian()

virtual void robotoc::CostFunctionComponentBase::evalImpactCostHessian ( Robot robot,
const ImpactStatus impact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTMatrix kkt_matrix 
) const
pure virtual

Computes the Hessian, i.e., the second-order partial derivatives of the impact cost. This function is always called just after evalImpactCostDerivatives().

Parameters
[in]robotRobot model.
[in]impact_statusImpact status.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
[in,out]kkt_matrixImpact split KKT matrix. The Hessians are
added to this object.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalStageCost()

virtual double robotoc::CostFunctionComponentBase::evalStageCost ( Robot robot,
const ContactStatus contact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s 
) const
pure virtual

Computes the stage cost.

Parameters
[in]robotRobot model.
[in]contact_statusContact status.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
Returns
Stage cost.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalStageCostDerivatives()

virtual void robotoc::CostFunctionComponentBase::evalStageCostDerivatives ( Robot robot,
const ContactStatus contact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTResidual kkt_residual 
) const
pure virtual

Computes the first-order partial derivatives of the stage cost. This function is always called just after evalStageCost().

Parameters
[in]robotRobot model.
[in]contact_statusContact status.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
[in,out]kkt_residualSplit KKT residual. The partial derivatives are added to this object.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalStageCostHessian()

virtual void robotoc::CostFunctionComponentBase::evalStageCostHessian ( Robot robot,
const ContactStatus contact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTMatrix kkt_matrix 
) const
pure virtual

Computes the Hessian, i.e., the second-order partial derivatives of the stage cost. This function is always called just after evalStageCostDerivatives().

Parameters
[in]robotRobot model.
[in]contact_statusContact status.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
[in,out]kkt_matrixSplit KKT matrix. The Hessians are added to this object.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalTerminalCost()

virtual double robotoc::CostFunctionComponentBase::evalTerminalCost ( Robot robot,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s 
) const
pure virtual

Computes the terminal cost.

Parameters
[in]robotRobot model.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
Returns
Terminal cost.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalTerminalCostDerivatives()

virtual void robotoc::CostFunctionComponentBase::evalTerminalCostDerivatives ( Robot robot,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTResidual kkt_residual 
) const
pure virtual

Computes the first-order partial derivatives of the terminal cost. This function is always called just after evalTerminalCost().

Parameters
[in]robotRobot model.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
[in,out]kkt_residualSplit KKT residual. The partial derivatives are added to this object.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ evalTerminalCostHessian()

virtual void robotoc::CostFunctionComponentBase::evalTerminalCostHessian ( Robot robot,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTMatrix kkt_matrix 
) const
pure virtual

Computes the Hessian, i.e., the second-order partial derivatives of the teminal cost. This function is always called just after evalTerminalCostDerivatives().

Parameters
[in]robotRobot model.
[in]dataCost function data.
[in]grid_infoGrid info.
[in]sSplit solution.
[in,out]kkt_matrixSplit KKT matrix. The Hessians are added to this object.

Implemented in robotoc::CoMCost, robotoc::ConfigurationSpaceCost, robotoc::LocalContactForceCost, robotoc::TaskSpace3DCost, and robotoc::TaskSpace6DCost.

◆ operator=() [1/2]

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

Default copy operator.

◆ operator=() [2/2]

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

Default move assign operator.


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