robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::LocalContactForceCost Class Referencefinal

Cost on the contact forces expressed in the local frames. More...

#include <local_contact_force_cost.hpp>

Inheritance diagram for robotoc::LocalContactForceCost:
Collaboration diagram for robotoc::LocalContactForceCost:

Public Member Functions

 LocalContactForceCost (const Robot &robot)
 Constructor. More...
 
 LocalContactForceCost ()
 Default constructor. More...
 
 ~LocalContactForceCost ()
 Destructor. More...
 
 LocalContactForceCost (const LocalContactForceCost &)=default
 Default copy constructor. More...
 
LocalContactForceCostoperator= (const LocalContactForceCost &)=default
 Default copy operator. More...
 
 LocalContactForceCost (LocalContactForceCost &&) noexcept=default
 Default move constructor. More...
 
LocalContactForceCostoperator= (LocalContactForceCost &&) noexcept=default
 Default move assign operator. More...
 
void set_f_ref (const std::vector< Eigen::Vector3d > &f_ref)
 Sets the reference contact forces expressed in the local frames. More...
 
void set_f_weight (const std::vector< Eigen::Vector3d > &f_weight)
 Sets the weight vectors on the contact forces. More...
 
void set_fi_ref (const std::vector< Eigen::Vector3d > &fi_ref)
 Sets the reference impact forces expressed in the local frames. More...
 
void set_fi_weight (const std::vector< Eigen::Vector3d > &fi_weight)
 Sets the weight vectors on the impact forces. More...
 
double evalStageCost (Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
 Computes the stage cost. More...
 
void evalStageCostDerivatives (Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTResidual &kkt_residual) const override
 Computes the first-order partial derivatives of the stage cost. This function is always called just after evalStageCost(). More...
 
void evalStageCostHessian (Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTMatrix &kkt_matrix) const override
 Computes the Hessian, i.e., the second-order partial derivatives of the stage cost. This function is always called just after evalStageCostDerivatives(). More...
 
double evalTerminalCost (Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
 Computes the terminal cost. More...
 
void evalTerminalCostDerivatives (Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTResidual &kkt_residual) const override
 Computes the first-order partial derivatives of the terminal cost. This function is always called just after evalTerminalCost(). More...
 
void evalTerminalCostHessian (Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTMatrix &kkt_matrix) const override
 Computes the Hessian, i.e., the second-order partial derivatives of the teminal cost. This function is always called just after evalTerminalCostDerivatives(). More...
 
double evalImpactCost (Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
 Computes the impact cost. More...
 
void evalImpactCostDerivatives (Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTResidual &kkt_residual) const override
 Computes the first-order partial derivatives of the impact cost. This function is always called just after evalImpactCost(). More...
 
void evalImpactCostHessian (Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s, SplitKKTMatrix &kkt_matrix) const override
 Computes the Hessian, i.e., the second-order partial derivatives of the impact cost. This function is always called just after evalImpactCostDerivatives(). More...
 
- Public Member Functions inherited from robotoc::CostFunctionComponentBase
 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

Cost on the contact forces expressed in the local frames.

Constructor & Destructor Documentation

◆ LocalContactForceCost() [1/4]

robotoc::LocalContactForceCost::LocalContactForceCost ( const Robot robot)

Constructor.

Parameters
[in]robotRobot model.

◆ LocalContactForceCost() [2/4]

robotoc::LocalContactForceCost::LocalContactForceCost ( )

Default constructor.

◆ ~LocalContactForceCost()

robotoc::LocalContactForceCost::~LocalContactForceCost ( )

Destructor.

◆ LocalContactForceCost() [3/4]

robotoc::LocalContactForceCost::LocalContactForceCost ( const LocalContactForceCost )
default

Default copy constructor.

◆ LocalContactForceCost() [4/4]

robotoc::LocalContactForceCost::LocalContactForceCost ( LocalContactForceCost &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ evalImpactCost()

double robotoc::LocalContactForceCost::evalImpactCost ( Robot robot,
const ImpactStatus impact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s 
) const
overridevirtual

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalImpactCostDerivatives()

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

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalImpactCostHessian()

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

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalStageCost()

double robotoc::LocalContactForceCost::evalStageCost ( Robot robot,
const ContactStatus contact_status,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s 
) const
overridevirtual

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalStageCostDerivatives()

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

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalStageCostHessian()

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

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalTerminalCost()

double robotoc::LocalContactForceCost::evalTerminalCost ( Robot robot,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s 
) const
overridevirtual

Computes the terminal cost.

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

Implements robotoc::CostFunctionComponentBase.

◆ evalTerminalCostDerivatives()

void robotoc::LocalContactForceCost::evalTerminalCostDerivatives ( Robot robot,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTResidual kkt_residual 
) const
overridevirtual

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.

Implements robotoc::CostFunctionComponentBase.

◆ evalTerminalCostHessian()

void robotoc::LocalContactForceCost::evalTerminalCostHessian ( Robot robot,
CostFunctionData data,
const GridInfo grid_info,
const SplitSolution s,
SplitKKTMatrix kkt_matrix 
) const
overridevirtual

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.

Implements robotoc::CostFunctionComponentBase.

◆ operator=() [1/2]

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

Default copy operator.

◆ operator=() [2/2]

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

Default move assign operator.

◆ set_f_ref()

void robotoc::LocalContactForceCost::set_f_ref ( const std::vector< Eigen::Vector3d > &  f_ref)

Sets the reference contact forces expressed in the local frames.

Parameters
[in]f_refReference contact forces expressed in the local frames. Size must be Robot::maxNumContacts().

◆ set_f_weight()

void robotoc::LocalContactForceCost::set_f_weight ( const std::vector< Eigen::Vector3d > &  f_weight)

Sets the weight vectors on the contact forces.

Parameters
[in]f_weightWeight vectors on the contact forces. Size must be Robot::maxNumContacts().

◆ set_fi_ref()

void robotoc::LocalContactForceCost::set_fi_ref ( const std::vector< Eigen::Vector3d > &  fi_ref)

Sets the reference impact forces expressed in the local frames.

Parameters
[in]fi_refReference impact forces expressed in the local frames. Size must be Robot::maxNumContacts().

◆ set_fi_weight()

void robotoc::LocalContactForceCost::set_fi_weight ( const std::vector< Eigen::Vector3d > &  fi_weight)

Sets the weight vectors on the impact forces.

Parameters
[in]fi_weightWeight vectors on the impact forces. Size must be Robot::maxNumContacts().

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