task-cop-equality.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 University of Trento
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_cop_equality_hpp__
19 #define __invdyn_task_cop_equality_hpp__
20 
21 #include "tsid/math/fwd.hpp"
26 
27 namespace tsid
28 {
29  namespace tasks
30  {
31 
33  {
34  public:
35  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36 
37  typedef math::Index Index;
43 
44  TaskCopEquality(const std::string & name,
45  RobotWrapper & robot);
46 
47  void setContactList(const std::vector<std::shared_ptr<ContactLevel> > *contacts);
48 
49  int dim() const;
50 
51  virtual const std::string& getAssociatedContactName();
52 
53  const ConstraintBase & compute(const double t,
56  Data & data);
57 
58  const ConstraintBase & compute(const double t,
61  Data & data,
62  const std::vector<std::shared_ptr<ContactLevel> > *contacts);
63 
64  const ConstraintBase & getConstraint() const;
65 
66  void setReference(const Vector3 & ref);
67  const Vector3 & getReference() const;
68 
69  void setContactNormal(const Vector3 & n);
70  const Vector3 & getContactNormal() const;
71 
72  protected:
73  const std::vector<std::shared_ptr<ContactLevel> > *m_contacts;
74  std::string m_contact_name; // an empty string
75  Vector3 m_normal; // normal direction to the ground expressed in world frame
76  Vector3 m_ref; // reference CoP in world frame
77  ConstraintEquality m_constraint;
78  };
79 
80  }
81 }
82 
83 #endif // ifndef __invdyn_task_com_equality_hpp__
std::size_t Index
Definition: fwd.hpp:55
Definition: constraint-equality.hpp:28
void setReference(const Vector3 &ref)
Definition: task-cop-equality.cpp:103
std::string m_contact_name
Definition: task-cop-equality.hpp:74
pinocchio::Data Data
Definition: task-base.hpp:43
virtual const std::string & getAssociatedContactName()
Definition: task-cop-equality.cpp:47
const std::string & name() const
Definition: task-base.cpp:30
const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)
Definition: task-cop-equality.cpp:61
math::ConstraintEquality ConstraintEquality
Definition: task-cop-equality.hpp:41
pinocchio::SE3 SE3
Definition: trajectory-base.hpp:34
Definition: task-contact-force.hpp:30
void setContactList(const std::vector< std::shared_ptr< ContactLevel > > *contacts)
Definition: task-cop-equality.cpp:37
trajectories::TrajectorySample TrajectorySample
Definition: task-cop-equality.hpp:38
const std::vector< std::shared_ptr< ContactLevel > > * m_contacts
Definition: task-cop-equality.hpp:73
Eigen::Matrix< Scalar, 3, 1 > Vector3
Definition: fwd.hpp:42
Definition: trajectory-base.hpp:35
const Vector3 & getContactNormal() const
Definition: task-cop-equality.cpp:119
Vector3 m_ref
Definition: task-cop-equality.hpp:76
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Index Index
Definition: task-cop-equality.hpp:37
const ConstraintBase & getConstraint() const
Definition: task-cop-equality.cpp:98
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:42
void setContactNormal(const Vector3 &n)
Definition: task-cop-equality.cpp:114
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
const Vector3 & getReference() const
Definition: task-cop-equality.cpp:109
Wrapper for a robot based on pinocchio.
Definition: robot-wrapper.hpp:40
Vector3 m_normal
Definition: task-cop-equality.hpp:75
ConstraintEquality m_constraint
Definition: task-cop-equality.hpp:77
TaskCopEquality(const std::string &name, RobotWrapper &robot)
Definition: task-cop-equality.cpp:28
math::Vector Vector
Definition: task-cop-equality.hpp:39
Definition: constraint-bound.hpp:26
int dim() const
Return the dimension of the task. should be overloaded in the child class.
Definition: task-cop-equality.cpp:42
math::Vector3 Vector3
Definition: task-cop-equality.hpp:40
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:36
Definition: task-cop-equality.hpp:32
pinocchio::SE3 SE3
Definition: task-cop-equality.hpp:42