tsid  1.8.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
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 namespace tasks {
29 
31  public:
32  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
33 
34  typedef math::Index Index;
40 
41  TaskCopEquality(const std::string& name, RobotWrapper& robot);
42 
43  void setContactList(
44  const std::vector<std::shared_ptr<ContactLevel> >* contacts);
45 
46  int dim() const override;
47 
48  const std::string& getAssociatedContactName() override;
49 
51  Data& data) override;
52 
53  const ConstraintBase& compute(
54  double t, ConstRefVector q, ConstRefVector v, Data& data,
55  const std::vector<std::shared_ptr<ContactLevel> >* contacts) override;
56 
57  const ConstraintBase& getConstraint() const override;
58 
59  void setReference(const Vector3& ref);
60 
61  const Vector3& getReference() const;
62 
63  void setContactNormal(const Vector3& n);
64 
65  const Vector3& getContactNormal() const;
66 
67  protected:
68  const std::vector<std::shared_ptr<ContactLevel> >* m_contacts;
69  std::string m_contact_name; // an empty string
70  Vector3 m_normal; // normal direction to the ground expressed in world frame
71  Vector3 m_ref; // reference CoP in world frame
73 };
74 
75 } // namespace tasks
76 } // namespace tsid
77 
78 #endif // ifndef __invdyn_task_com_equality_hpp__
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:35
Definition: constraint-equality.hpp:26
Wrapper for a robot based on pinocchio.
Definition: robot-wrapper.hpp:37
const std::string & name() const
Definition: task-base.cpp:25
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:39
pinocchio::Data Data
Definition: task-base.hpp:40
Definition: task-contact-force.hpp:28
Definition: task-cop-equality.hpp:30
math::Vector Vector
Definition: task-cop-equality.hpp:36
Vector3 m_normal
Definition: task-cop-equality.hpp:70
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Index Index
Definition: task-cop-equality.hpp:34
const std::vector< std::shared_ptr< ContactLevel > > * m_contacts
Definition: task-cop-equality.hpp:68
const ConstraintBase & getConstraint() const override
Definition: task-cop-equality.cpp:86
const Vector3 & getContactNormal() const
Definition: task-cop-equality.cpp:100
ConstraintEquality m_constraint
Definition: task-cop-equality.hpp:72
int dim() const override
Return the dimension of the task. \info should be overloaded in the child class.
Definition: task-cop-equality.cpp:39
void setContactList(const std::vector< std::shared_ptr< ContactLevel > > *contacts)
Definition: task-cop-equality.cpp:34
math::ConstraintEquality ConstraintEquality
Definition: task-cop-equality.hpp:38
void setReference(const Vector3 &ref)
Definition: task-cop-equality.cpp:90
TaskCopEquality(const std::string &name, RobotWrapper &robot)
Definition: task-cop-equality.cpp:26
math::Vector3 Vector3
Definition: task-cop-equality.hpp:37
Vector3 m_ref
Definition: task-cop-equality.hpp:71
std::string m_contact_name
Definition: task-cop-equality.hpp:69
void setContactNormal(const Vector3 &n)
Definition: task-cop-equality.cpp:98
trajectories::TrajectorySample TrajectorySample
Definition: task-cop-equality.hpp:35
pinocchio::SE3 SE3
Definition: task-cop-equality.hpp:39
const std::string & getAssociatedContactName() override
Definition: task-cop-equality.cpp:41
const ConstraintBase & compute(double t, ConstRefVector q, ConstRefVector v, Data &data) override
Definition: task-cop-equality.cpp:51
const Vector3 & getReference() const
Definition: task-cop-equality.cpp:96
Definition: trajectory-base.hpp:33
std::size_t Index
Definition: fwd.hpp:53
Eigen::Matrix< Scalar, 3, 1 > Vector3
Definition: fwd.hpp:40
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:35
pinocchio::SE3 SE3
Definition: trajectory-base.hpp:31
Definition: constraint-bound.hpp:25