mc_rtc  2.13.0
ContactConstraint.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2022 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
8 
9 #include <mc_rtc/void_ptr.h>
10 
11 #include <Tasks/QPContactConstr.h>
12 
13 namespace mc_solver
14 {
15 
21 {
22 public:
26  enum class ContactType
27  {
29  Acceleration = 0,
31  Velocity = 1,
33  Position = 2
34  };
35 
36 public:
44  ContactConstraint(double timeStep, ContactType contactType = ContactType::Velocity);
45 
47  void addToSolverImpl(QPSolver & solver) override;
48 
50  void removeFromSolverImpl(QPSolver & solver) override;
51 
56  tasks::qp::ContactConstr * contactConstr();
57 
59  ContactType contactType() const noexcept { return contactType_; }
60 
61 private:
69  mc_rtc::void_ptr constraint_;
70  ContactType contactType_;
71 };
72 
73 } // namespace mc_solver
#define MC_SOLVER_DLLAPI
Definition: api.h:50
std::unique_ptr< void, void(*)(void *)> void_ptr
Definition: void_ptr.h:14
Definition: Contact.h:18
This class is a basis to wrap Constraint functions from Tasks. The aim of such wrappers should be two...
Definition: ConstraintSet.h:21
Definition: ContactConstraint.h:21
void removeFromSolverImpl(QPSolver &solver) override
ContactType contactType() const noexcept
Definition: ContactConstraint.h:59
ContactConstraint(double timeStep, ContactType contactType=ContactType::Velocity)
tasks::qp::ContactConstr * contactConstr()
ContactType
Definition: ContactConstraint.h:27
void addToSolverImpl(QPSolver &solver) override
Definition: QPSolver.h:86