task-joint-posture.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_joint_posture_hpp__
19 #define __invdyn_task_joint_posture_hpp__
20 
24 #include <tsid/deprecated.hh>
25 
26 namespace tsid
27 {
28  namespace tasks
29  {
30 
32  {
33  public:
34  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
35 
36  typedef math::Index Index;
42 
43  TaskJointPosture(const std::string & name,
44  RobotWrapper & robot);
45 
46  int dim() const;
47 
48  const ConstraintBase & compute(const double t,
51  Data & data);
52 
53  const ConstraintBase & getConstraint() const;
54 
55  void setReference(const TrajectorySample & ref);
56  const TrajectorySample & getReference() const;
57 
58  const Vector & getDesiredAcceleration() const;
59  Vector getAcceleration(ConstRefVector dv) const;
60 
61  TSID_DEPRECATED const Vector & mask() const; // deprecated
62  TSID_DEPRECATED void mask(const Vector & mask); // deprecated
63  virtual void setMask(math::ConstRefVector mask);
64 
65  const Vector & position_error() const;
66  const Vector & velocity_error() const;
67  const Vector & position() const;
68  const Vector & velocity() const;
69  const Vector & position_ref() const;
70  const Vector & velocity_ref() const;
71 
72  const Vector & Kp();
73  const Vector & Kd();
74  void Kp(ConstRefVector Kp);
75  void Kd(ConstRefVector Kp);
76 
77  protected:
78  Vector m_Kp;
79  Vector m_Kd;
81  Vector m_p, m_v;
82  Vector m_a_des;
83  VectorXi m_activeAxes;
84  TrajectorySample m_ref;
86  ConstraintEquality m_constraint;
87  };
88 
89  }
90 }
91 
92 #endif // ifndef __invdyn_task_joint_posture_hpp__
std::size_t Index
Definition: fwd.hpp:55
TSID_DEPRECATED const Vector & mask() const
Definition: task-joint-posture.cpp:43
TaskJointPosture(const std::string &name, RobotWrapper &robot)
Definition: task-joint-posture.cpp:30
Definition: constraint-equality.hpp:28
trajectories::TrajectorySample TrajectorySample
Definition: task-joint-posture.hpp:37
const TrajectorySample & getReference() const
Definition: task-joint-posture.cpp:103
const Vector & position_ref() const
Definition: task-joint-posture.cpp:138
Vector m_p_error
Definition: task-joint-posture.hpp:80
const Vector & velocity_ref() const
Definition: task-joint-posture.cpp:143
VectorXi m_activeAxes
Definition: task-joint-posture.hpp:83
Definition: task-joint-posture.hpp:31
const Vector & Kp()
Definition: task-joint-posture.cpp:79
pinocchio::Data Data
Definition: task-joint-posture.hpp:41
const std::string & name() const
Definition: task-base.cpp:30
const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)
Definition: task-joint-posture.cpp:153
void setReference(const TrajectorySample &ref)
Definition: task-joint-posture.cpp:95
Vector m_a_des
Definition: task-joint-posture.hpp:82
Vector m_v_error
Definition: task-joint-posture.hpp:80
const Vector & velocity() const
Definition: task-joint-posture.cpp:133
TrajectorySample m_ref
Definition: task-joint-posture.hpp:84
const Vector & position_error() const
Definition: task-joint-posture.cpp:118
Definition: task-motion.hpp:28
Vector m_Kp
Definition: task-joint-posture.hpp:78
Definition: trajectory-base.hpp:35
Vector m_v
Definition: task-joint-posture.hpp:81
math::VectorXi VectorXi
Definition: task-joint-posture.hpp:39
const Vector & velocity_error() const
Definition: task-joint-posture.cpp:123
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:42
ConstraintEquality m_constraint
Definition: task-joint-posture.hpp:86
int dim() const
Return the dimension of the task. should be overloaded in the child class.
Definition: task-joint-posture.cpp:74
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
Vector getAcceleration(ConstRefVector dv) const
Definition: task-joint-posture.cpp:113
const Vector & Kd()
Definition: task-joint-posture.cpp:81
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
math::ConstraintEquality ConstraintEquality
Definition: task-joint-posture.hpp:40
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Index Index
Definition: task-joint-posture.hpp:36
Wrapper for a robot based on pinocchio.
Definition: robot-wrapper.hpp:40
virtual void setMask(math::ConstRefVector mask)
Definition: task-joint-posture.cpp:54
Vector m_p
Definition: task-joint-posture.hpp:81
const Vector & position() const
Definition: task-joint-posture.cpp:128
math::Vector Vector
Definition: task-joint-posture.hpp:38
Vector m_ref_q_augmented
Definition: task-joint-posture.hpp:85
Vector m_Kd
Definition: task-joint-posture.hpp:79
Definition: constraint-bound.hpp:26
const Vector & getDesiredAcceleration() const
Definition: task-joint-posture.cpp:108
Eigen::VectorXi VectorXi
Definition: fwd.hpp:39
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:36
const ConstraintBase & getConstraint() const
Definition: task-joint-posture.cpp:148
pinocchio::Data Data
Definition: inverse-dynamics-formulation-acc-force.cpp:29