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 namespace tasks {
29 
34 class TaskBase {
35  public:
36  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
37 
42 
43  TaskBase(const std::string& name, RobotWrapper& robot);
44 
45  virtual ~TaskBase() {}
46 
47  const std::string& name() const;
48 
49  void name(const std::string& name);
50 
53  virtual int dim() const = 0;
54 
55  virtual const ConstraintBase& compute(const double t, ConstRefVector q,
56  ConstRefVector v, Data& data) = 0;
57 
58  virtual const ConstraintBase& getConstraint() const = 0;
59 
60  protected:
61  std::string m_name;
62 
64  RobotWrapper& m_robot;
65 };
66 
67 } // namespace tasks
68 } // namespace tsid
69 
70 #endif // ifndef __invdyn_task_base_hpp__
virtual const ConstraintBase & getConstraint() const =0
pinocchio::Data Data
Definition: task-base.hpp:40
Base template of a Task. Each class is defined according to a constant model of a robot...
Definition: task-base.hpp:34
const std::string & name() const
Definition: task-base.cpp:25
virtual int dim() const =0
Return the dimension of the task. should be overloaded in the child class.
RobotWrapper & m_robot
Reference on the robot model.
Definition: task-base.hpp:64
robots::RobotWrapper RobotWrapper
Definition: task-base.hpp:41
virtual const ConstraintBase & compute(const double t, ConstRefVector q, ConstRefVector v, Data &data)=0
data
Definition: setup.in.py:48
TaskBase(const std::string &name, RobotWrapper &robot)
Definition: task-base.cpp:22
math::ConstRefVector ConstRefVector
Definition: task-base.hpp:39
const Eigen::Ref< const Vector > ConstRefVector
Definition: math/fwd.hpp:48
Wrapper for a robot based on pinocchio.
std::string m_name
Definition: task-base.hpp:61
Transform3f t
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::ConstraintBase ConstraintBase
Definition: task-base.hpp:38
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sun Jul 2 2023 02:21:51