robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
local_contact_force_cost.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_LOCAL_CONTACT_FORCE_COST_HPP_
2#define ROBOTOC_LOCAL_CONTACT_FORCE_COST_HPP_
3
4#include <vector>
5
6#include "Eigen/Core"
7
16
17
18namespace robotoc {
19
25public:
31
36
41
46
51
56
60 LocalContactForceCost& operator=(LocalContactForceCost&&) noexcept = default;
61
67 void set_f_ref(const std::vector<Eigen::Vector3d>& f_ref);
68
74 void set_f_weight(const std::vector<Eigen::Vector3d>& f_weight);
75
81 void set_fi_ref(const std::vector<Eigen::Vector3d>& fi_ref);
82
88 void set_fi_weight(const std::vector<Eigen::Vector3d>& fi_weight);
89
90 double evalStageCost(Robot& robot, const ContactStatus& contact_status,
91 CostFunctionData& data, const GridInfo& grid_info,
92 const SplitSolution& s) const override;
93
94 void evalStageCostDerivatives(Robot& robot, const ContactStatus& contact_status,
95 CostFunctionData& data, const GridInfo& grid_info,
96 const SplitSolution& s,
97 SplitKKTResidual& kkt_residual) const override;
98
99 void evalStageCostHessian(Robot& robot, const ContactStatus& contact_status,
100 CostFunctionData& data, const GridInfo& grid_info,
101 const SplitSolution& s,
102 SplitKKTMatrix& kkt_matrix) const override;
103
105 const GridInfo& grid_info,
106 const SplitSolution& s) const override;
107
109 const GridInfo& grid_info,
110 const SplitSolution& s,
111 SplitKKTResidual& kkt_residual) const override;
112
114 const GridInfo& grid_info,
115 const SplitSolution& s,
116 SplitKKTMatrix& kkt_matrix) const override;
117
118 double evalImpactCost(Robot& robot, const ImpactStatus& impact_status,
119 CostFunctionData& data, const GridInfo& grid_info,
120 const SplitSolution& s) const override;
121
122 void evalImpactCostDerivatives(Robot& robot, const ImpactStatus& impact_status,
123 CostFunctionData& data, const GridInfo& grid_info,
124 const SplitSolution& s,
125 SplitKKTResidual& kkt_residual) const override;
126
127 void evalImpactCostHessian(Robot& robot, const ImpactStatus& impact_status,
128 CostFunctionData& data, const GridInfo& grid_info,
129 const SplitSolution& s,
130 SplitKKTMatrix& kkt_matrix) const override;
131
132 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
133
134private:
135 int max_num_contacts_, max_dimf_;
136 std::vector<ContactType> contact_types_;
137 std::vector<Eigen::Vector3d> f_ref_, f_weight_, fi_ref_, fi_weight_;
138
139};
140
141} // namespace robotoc
142
143
144#endif // ROBOTOC_LOCAL_CONTACT_FORCE_COST_HPP_
Contact status of robot model.
Definition: contact_status.hpp:32
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
Cost on the contact forces expressed in the local frames.
Definition: local_contact_force_cost.hpp:24
LocalContactForceCost(LocalContactForceCost &&) 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...
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_f_weight(const std::vector< Eigen::Vector3d > &f_weight)
Sets the weight vectors on the contact forces.
LocalContactForceCost & operator=(const LocalContactForceCost &)=default
Default copy operator.
double evalImpactCost(Robot &robot, const ImpactStatus &impact_status, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
Computes the impact cost.
void set_f_ref(const std::vector< Eigen::Vector3d > &f_ref)
Sets the reference contact forces expressed in the local frames.
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...
LocalContactForceCost(const Robot &robot)
Constructor.
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 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_fi_ref(const std::vector< Eigen::Vector3d > &fi_ref)
Sets the reference impact forces expressed in the local frames.
double evalTerminalCost(Robot &robot, CostFunctionData &data, const GridInfo &grid_info, const SplitSolution &s) const override
Computes the terminal cost.
void set_fi_weight(const std::vector< Eigen::Vector3d > &fi_weight)
Sets the weight vectors on the impact forces.
LocalContactForceCost(const LocalContactForceCost &)=default
Default copy constructor.
LocalContactForceCost()
Default constructor.
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 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....
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
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
ContactType
Types of contacts.
Definition: contact_status.hpp:22
Composed of data used to compute the cost function and its derivatives.
Definition: cost_function_data.hpp:17
Grid information.
Definition: grid_info.hpp:24