1#ifndef ROBOTOC_COM_COST_HPP_
2#define ROBOTOC_COM_COST_HPP_
37 CoMCost(
const Robot& robot,
const std::shared_ptr<CoMRefBase>& ref);
114 if (use_nonconst_ref_) {
115 return ref_->isActive(grid_info);
131 if (use_nonconst_ref_) {
132 if (ref_->isActive(grid_info)) {
133 ref_->updateRef(grid_info, data.
x3d_ref);
181 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
184 Eigen::Vector3d const_ref_, weight_, weight_terminal_, weight_impact_;
185 std::shared_ptr<CoMRefBase> ref_;
186 bool use_nonconst_ref_, enable_cost_, enable_cost_terminal_, enable_cost_impact_;
Cost on the position of the center of mass.
Definition: com_cost.hpp:24
CoMCost(const CoMCost &)=default
Default copy constructor.
CoMCost(const Robot &robot, const Eigen::Vector3d &const_ref)
Constructor.
void evalDiff(const Robot &robot, CostFunctionData &data, const GridInfo &grid_info) const
Evaluate the difference between the robot's task-space position status and reference.
Definition: com_cost.hpp:129
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....
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....
double evalStageCost(Robot &robot, const ContactStatus &contact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
Computes the stage cost.
void set_ref(const std::shared_ptr< CoMRefBase > &ref)
Sets the reference CoM position.
CoMCost()
Default constructor.
double evalImpactCost(Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
Computes the impact cost.
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 ...
void set_weight_impact(const Eigen::Vector3d &weight_impact)
Sets the weight vector for the impact stage.
CoMCost(CoMCost &&) noexcept=default
Default move constructor.
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 a...
void set_weight_terminal(const Eigen::Vector3d &weight_terminal)
Sets the weight vector for the terminal stage.
void set_weight(const Eigen::Vector3d &weight)
Sets the weight vector.
CoMCost & operator=(const CoMCost &)=default
Default copy operator.
CoMCost(const Robot &robot)
Constructor.
bool isCostActive(const GridInfo &grid_info) const
Evaluate if the cost is active for given grid_info.
Definition: com_cost.hpp:113
double evalTerminalCost(Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
Computes the terminal cost.
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 jus...
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....
void set_const_ref(const Eigen::Vector3d &const_ref)
Sets the const reference CoM position.
CoMCost(const Robot &robot, const std::shared_ptr< CoMRefBase > &ref)
Constructor.
Base class of reference position of the center of mass (CoM).
Definition: com_ref_base.hpp:15
Base class of components of cost function.
Definition: cost_function_component_base.hpp:25
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
Definition: impact_status.hpp:21
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
const Eigen::Vector3d & CoM() const
Returns the position of the center of mass. Before calling this function, updateKinematics() or updat...
The KKT matrix split into a time stage.
Definition: split_kkt_matrix.hpp:18
KKT residual split into each time stage.
Definition: split_kkt_residual.hpp:18
Solution to the optimal control problem split into a time stage.
Definition: split_solution.hpp:20
Definition: constraint_component_base.hpp:17
Composed of data used to compute the cost function and its derivatives.
Definition: cost_function_data.hpp:17
Eigen::VectorXd x3d_ref
Vector used for set the reference position of the end-effector in TaskSpace3DCost....
Definition: cost_function_data.hpp:76
Eigen::VectorXd diff_3d
Vector used for computing the difference of the position of the end-effector in TaskSpace3DCost....
Definition: cost_function_data.hpp:84
Grid information.
Definition: grid_info.hpp:24