task-base.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_base_hpp__
19 #define __invdyn_task_base_hpp__
20 
21 #include "tsid/math/fwd.hpp"
22 #include "tsid/robots/fwd.hpp"
24 
25 #include <pinocchio/multibody/fwd.hpp>
26 
27 namespace tsid
28 {
29  namespace tasks
30  {
31 
36  class TaskBase
37  {
38  public:
39  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 
45 
46  TaskBase(const std::string & name,
47  RobotWrapper & robot);
48 
49  const std::string & name() const;
50 
51  void name(const std::string & name);
52 
55  virtual int dim() const = 0;
56 
57  virtual const ConstraintBase & compute(const double t,
60  Data & data) = 0;
61 
62  virtual const ConstraintBase & getConstraint() const = 0;
63 
64  protected:
65  std::string m_name;
66 
69  };
70 
71  }
72 }
73 
74 #endif // ifndef __invdyn_task_base_hpp__
tsid::tasks::TaskBase::dim
virtual int dim() const =0
Return the dimension of the task. \info should be overloaded in the child class.
tsid::tasks::TaskBase::getConstraint
virtual const ConstraintBase & getConstraint() const =0
tsid::tasks::TaskBase
Base template of a Task. Each class is defined according to a constant model of a robot.
Definition: task-base.hpp:36
tsid::tasks::TaskBase::TaskBase
TaskBase(const std::string &name, RobotWrapper &robot)
Definition: task-base.cpp:24
tsid::tasks::TaskBase::compute
virtual const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)=0
Data
pinocchio::Data Data
Definition: inverse-dynamics-formulation-acc-force.cpp:29
tsid::math::ConstraintBase
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:36
tsid::tasks::TaskBase::ConstraintBase
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::ConstraintBase ConstraintBase
Definition: task-base.hpp:41
fwd.hpp
constraint-base.hpp
tsid::tasks::TaskBase::RobotWrapper
robots::RobotWrapper RobotWrapper
Definition: task-base.hpp:44
tsid::math::ConstRefVector
const typedef Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
tsid::tasks::TaskBase::Data
pinocchio::Data Data
Definition: task-base.hpp:43
fwd.hpp
tsid
Definition: constraint-bound.hpp:26
tsid::tasks::TaskBase::m_name
std::string m_name
Definition: task-base.hpp:65
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::TaskBase::m_robot
RobotWrapper & m_robot
Reference on the robot model.
Definition: task-base.hpp:68
tsid::tasks::TaskBase::ConstRefVector
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:42