tasks/task-contact-force-equality.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef __invdyn_task_contact_force_equality_hpp__
19 #define __invdyn_task_contact_force_equality_hpp__
20 
21 #include "tsid/math/fwd.hpp"
26 
27 namespace tsid {
28 namespace tasks {
29 
31  public:
32  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
33 
34  typedef math::Index Index;
41 
42  TaskContactForceEquality(const std::string& name, RobotWrapper& robot,
43  const double dt, contacts::ContactBase& contact);
44 
46 
47  int dim() const;
48 
49  virtual const std::string& getAssociatedContactName();
52 
53  // Task expressed as a PID between the reference force and the external one
54  const ConstraintBase& compute(const double t, ConstRefVector q,
56 
57  const ConstraintBase& compute(
58  const double t, ConstRefVector q, ConstRefVector v, Data& data,
59  const std::vector<std::shared_ptr<ContactLevel> >* contacts);
60 
61  const ConstraintBase& getConstraint() const;
62 
63  void setReference(TrajectorySample& ref);
64  const TrajectorySample& getReference() const;
65 
66  void setExternalForce(TrajectorySample& f_ext);
67  const TrajectorySample& getExternalForce() const;
68 
69  const Vector& Kp() const;
70  const Vector& Kd() const;
71  const Vector& Ki() const;
72  const double& getLeakRate() const;
73  void Kp(ConstRefVector Kp);
74  void Kd(ConstRefVector Kp);
75  void Ki(ConstRefVector Ki);
76  void setLeakRate(double leak);
77 
78  protected:
79  // contact associated to the force task
81  std::string m_contact_name; // the associated contact name or an empty string
82  ConstraintEquality m_constraint;
83  TrajectorySample m_ref; // reference Force 6D to follow
84  TrajectorySample m_fext; // external Force 6D in the same frame than the ref
85  Vector m_forceIntegralError; // Integral error of the PID
86  Vector m_Kp;
87  Vector m_Kd;
88  Vector m_Ki;
89  double m_dt;
90  double m_leak_rate;
91 };
92 
93 } // namespace tasks
94 } // namespace tsid
95 
96 #endif // ifndef __invdyn_task_contact_force_equality_hpp__
std::size_t Index
Definition: math/fwd.hpp:53
const std::string & name() const
Definition: task-base.cpp:25
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: math/fwd.hpp:35
data
Definition: setup.in.py:48
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Index Index
Base template of a Contact.
Eigen::Matrix< Scalar, 3, 1 > Vector3
Definition: math/fwd.hpp:40
virtual const contacts::ContactBase & getAssociatedContact()
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:39
void setAssociatedContact(contacts::ContactBase &contact)
int dim() const
Return the dimension of the task. should be overloaded in the child class.
Wrapper for a robot based on pinocchio.
TaskContactForceEquality(const std::string &name, RobotWrapper &robot, const double dt, contacts::ContactBase &contact)
Eigen::TensorRef< Tensor > ref(Eigen::TensorRef< Tensor > tensor)
Transform3f t
Eigen::Matrix< Scalar, 6, 1 > Vector6
Definition: math/fwd.hpp:41
const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sun Jul 2 2023 02:21:51