Loading...
Searching...
No Matches
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
27namespace tsid
28{
29 namespace tasks
30 {
31
33 {
34 public:
35 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36
42 typedef pinocchio::SE3 SE3;
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__
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:37
Definition: constraint-equality.hpp:29
Wrapper for a robot based on pinocchio.
Definition: robot-wrapper.hpp:41
const std::string & name() const
Definition: task-base.cpp:30
pinocchio::Data Data
Definition: task-base.hpp:43
Definition: task-contact-force.hpp:31
Definition: task-cop-equality.hpp:33
math::Vector Vector
Definition: task-cop-equality.hpp:39
Vector3 m_normal
Definition: task-cop-equality.hpp:75
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Index Index
Definition: task-cop-equality.hpp:37
const std::vector< std::shared_ptr< ContactLevel > > * m_contacts
Definition: task-cop-equality.hpp:73
const Vector3 & getContactNormal() const
Definition: task-cop-equality.cpp:119
int dim() const
Return the dimension of the task. \info should be overloaded in the child class.
Definition: task-cop-equality.cpp:42
ConstraintEquality m_constraint
Definition: task-cop-equality.hpp:77
void setContactList(const std::vector< std::shared_ptr< ContactLevel > > *contacts)
Definition: task-cop-equality.cpp:37
math::ConstraintEquality ConstraintEquality
Definition: task-cop-equality.hpp:41
void setReference(const Vector3 &ref)
Definition: task-cop-equality.cpp:103
math::Vector3 Vector3
Definition: task-cop-equality.hpp:40
Vector3 m_ref
Definition: task-cop-equality.hpp:76
const ConstraintBase & getConstraint() const
Definition: task-cop-equality.cpp:98
std::string m_contact_name
Definition: task-cop-equality.hpp:74
const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)
Definition: task-cop-equality.cpp:61
void setContactNormal(const Vector3 &n)
Definition: task-cop-equality.cpp:114
trajectories::TrajectorySample TrajectorySample
Definition: task-cop-equality.hpp:38
pinocchio::SE3 SE3
Definition: task-cop-equality.hpp:42
virtual const std::string & getAssociatedContactName()
Definition: task-cop-equality.cpp:47
const Vector3 & getReference() const
Definition: task-cop-equality.cpp:109
Definition: trajectory-base.hpp:36
std::size_t Index
Definition: fwd.hpp:55
Eigen::Matrix< Scalar, 3, 1 > Vector3
Definition: fwd.hpp:42
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
Definition: constraint-bound.hpp:27