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
78  };
79 
80  }
81 }
82 
83 #endif // ifndef __invdyn_task_com_equality_hpp__
tsid::tasks::TaskCopEquality::m_contacts
const std::vector< std::shared_ptr< ContactLevel > > * m_contacts
Definition: task-cop-equality.hpp:73
tsid::tasks::TaskCopEquality::dim
int dim() const
Return the dimension of the task. \info should be overloaded in the child class.
Definition: task-cop-equality.cpp:42
tsid::tasks::TaskCopEquality::TrajectorySample
trajectories::TrajectorySample TrajectorySample
Definition: task-cop-equality.hpp:38
tsid::tasks::TaskCopEquality::m_normal
Vector3 m_normal
Definition: task-cop-equality.hpp:75
tsid::tasks::TaskCopEquality::m_constraint
ConstraintEquality m_constraint
Definition: task-cop-equality.hpp:77
tsid::trajectories::TrajectorySample
Definition: trajectory-base.hpp:35
tsid::tasks::TaskCopEquality::TaskCopEquality
TaskCopEquality(const std::string &name, RobotWrapper &robot)
Definition: task-cop-equality.cpp:28
tsid::math::ConstraintEquality
Definition: constraint-equality.hpp:28
tsid::tasks::TaskCopEquality::setContactNormal
void setContactNormal(const Vector3 &n)
Definition: task-cop-equality.cpp:114
tsid::math::ConstraintBase
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:36
tsid::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
tsid::tasks::TaskContactForce
Definition: task-contact-force.hpp:30
tsid::tasks::TaskCopEquality::setContactList
void setContactList(const std::vector< std::shared_ptr< ContactLevel > > *contacts)
Definition: task-cop-equality.cpp:37
constraint-equality.hpp
tsid::python::SE3
pinocchio::SE3 SE3
Definition: trajectory-base.hpp:34
tsid::tasks::TaskCopEquality::getConstraint
const ConstraintBase & getConstraint() const
Definition: task-cop-equality.cpp:98
trajectory-base.hpp
tsid::tasks::TaskCopEquality::m_contact_name
std::string m_contact_name
Definition: task-cop-equality.hpp:74
tsid::math::Index
std::size_t Index
Definition: fwd.hpp:55
tsid::tasks::TaskCopEquality::compute
const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)
Definition: task-cop-equality.cpp:61
tsid::tasks::TaskCopEquality
Definition: task-cop-equality.hpp:32
fwd.hpp
tsid::tasks::TaskCopEquality::getReference
const Vector3 & getReference() const
Definition: task-cop-equality.cpp:109
tsid::tasks::TaskBase::Data
pinocchio::Data Data
Definition: task-base.hpp:43
tsid::tasks::TaskCopEquality::m_ref
Vector3 m_ref
Definition: task-cop-equality.hpp:76
inverse-dynamics-formulation-base.hpp
tsid::tasks::TaskCopEquality::setReference
void setReference(const Vector3 &ref)
Definition: task-cop-equality.cpp:103
tsid::tasks::TaskCopEquality::Index
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Index Index
Definition: task-cop-equality.hpp:37
tsid
Definition: constraint-bound.hpp:26
task-contact-force.hpp
tsid::tasks::TaskCopEquality::getContactNormal
const Vector3 & getContactNormal() const
Definition: task-cop-equality.cpp:119
tsid::robots::RobotWrapper
Wrapper for a robot based on pinocchio.
Definition: robot-wrapper.hpp:40
tsid::tasks::TaskBase::name
const std::string & name() const
Definition: task-base.cpp:30
tsid::tasks::TaskCopEquality::Vector3
math::Vector3 Vector3
Definition: task-cop-equality.hpp:40
tsid::tasks::TaskCopEquality::SE3
pinocchio::SE3 SE3
Definition: task-cop-equality.hpp:42
tsid::tasks::TaskCopEquality::ConstraintEquality
math::ConstraintEquality ConstraintEquality
Definition: task-cop-equality.hpp:41
tsid::math::Vector3
Eigen::Matrix< Scalar, 3, 1 > Vector3
Definition: fwd.hpp:42
tsid::tasks::TaskBase::ConstRefVector
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:42
tsid::tasks::TaskCopEquality::getAssociatedContactName
virtual const std::string & getAssociatedContactName()
Definition: task-cop-equality.cpp:47
tsid::tasks::TaskCopEquality::Vector
math::Vector Vector
Definition: task-cop-equality.hpp:39