robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
contact_wrench_cone.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_CONTACT_WRENCH_CONE_HPP_
2#define ROBOTOC_CONTACT_WRENCH_CONE_HPP_
3
4#include "Eigen/Core"
5
14
15
16namespace robotoc {
17
23public:
30 ContactWrenchCone(const Robot& robot, const double X, const double Y);
31
36
41
46
51
55 ContactWrenchCone(ContactWrenchCone&&) noexcept = default;
56
60 ContactWrenchCone& operator=(ContactWrenchCone&&) noexcept = default;
61
66 void setRectangular(const double X, const double Y);
67
69
70 void allocateExtraData(ConstraintComponentData& data) const override;
71
72 bool isFeasible(Robot& robot, const ContactStatus& contact_status,
74 const SplitSolution& s) const override;
75
76 void setSlack(Robot& robot, const ContactStatus& contact_status,
78 const SplitSolution& s) const override;
79
80 void evalConstraint(Robot& robot, const ContactStatus& contact_status,
82 const SplitSolution& s) const override;
83
84 void evalDerivatives(Robot& robot, const ContactStatus& contact_status,
86 SplitKKTResidual& kkt_residual) const override;
87
88 void condenseSlackAndDual(const ContactStatus& contact_status,
90 SplitKKTMatrix& kkt_matrix,
91 SplitKKTResidual& kkt_residual) const override;
92
93 void expandSlackAndDual(const ContactStatus& contact_status,
95 const SplitDirection& d) const override;
96
97 int dimc() const override;
98
99 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
100
101private:
102 int dimv_, dimc_, max_num_contacts_;
103 std::vector<int> contact_frame_;
104 std::vector<ContactType> contact_types_;
105 double X_, Y_;
106
107 void computeCone(const double mu, Eigen::MatrixXd& cone) const;
108 void updateCone(const double mu, Eigen::MatrixXd& cone) const;
109
110};
111
112} // namespace robotoc
113
114#endif // ROBOTOC_CONTACT_WRENCH_CONE_HPP_
Base class for constraint components.
Definition: constraint_component_base.hpp:34
Data used in constraint components. Composed by slack, dual (Lagrange multiplier),...
Definition: constraint_component_data.hpp:17
Contact status of robot model.
Definition: contact_status.hpp:32
Constraint on the contact wrench cone for surface contacts.
Definition: contact_wrench_cone.hpp:22
ContactWrenchCone()
Default constructor.
ContactWrenchCone & operator=(const ContactWrenchCone &)=default
Default copy operator.
void evalDerivatives(Robot &robot, const ContactStatus &contact_status, ConstraintComponentData &data, const SplitSolution &s, SplitKKTResidual &kkt_residual) const override
Computes the derivatives of the priaml residual, i.e., the Jacobian of the inequality constraint,...
void condenseSlackAndDual(const ContactStatus &contact_status, ConstraintComponentData &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual) const override
Condenses the slack and dual variables, i.e., factorizes the condensed Hessians and KKT residuals....
void setRectangular(const double X, const double Y)
int dimc() const override
Returns the size of the constraint.
~ContactWrenchCone()
Destructor.
ContactWrenchCone(const Robot &robot, const double X, const double Y)
Constructor.
KinematicsLevel kinematicsLevel() const override
Checks the kinematics level of the constraint component.
bool isFeasible(Robot &robot, const ContactStatus &contact_status, ConstraintComponentData &data, const SplitSolution &s) const override
Checks whether the current solution s is feasible or not.
void evalConstraint(Robot &robot, const ContactStatus &contact_status, ConstraintComponentData &data, const SplitSolution &s) const override
Computes the primal residual, residual in the complementary slackness, and the log-barrier function o...
void allocateExtraData(ConstraintComponentData &data) const override
Allocates extra data in ConstraintComponentData.
ContactWrenchCone(ContactWrenchCone &&) noexcept=default
Default move constructor.
ContactWrenchCone(const ContactWrenchCone &)=default
Default copy constructor.
void expandSlackAndDual(const ContactStatus &contact_status, ConstraintComponentData &data, const SplitDirection &d) const override
Expands the slack and dual, i.e., computes the directions of the slack and dual variables from the di...
void setSlack(Robot &robot, const ContactStatus &contact_status, ConstraintComponentData &data, const SplitSolution &s) const override
Sets the slack variables of each constraint components.
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Newton direction of the solution to the optimal control problem split into a time stage.
Definition: split_direction.hpp:20
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
KinematicsLevel
Kinematics level of the constraint component used in ConstraintComponentBase.
Definition: constraint_component_base.hpp:24