task-actuation-bounds.hpp 2.11 KB
Newer Older
1
2
3
//
// Copyright (c) 2017 CNRS
//
jcarpent's avatar
jcarpent committed
4
5
// This file is part of tsid
// tsid is free software: you can redistribute it
6
7
8
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
jcarpent's avatar
jcarpent committed
9
// tsid is distributed in the hope that it will be
10
11
12
13
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
jcarpent's avatar
jcarpent committed
14
// tsid If not, see
15
16
17
// <http://www.gnu.org/licenses/>.
//

18
19
20
21
22
23
#ifndef __invdyn_task_actuation_bounds_hpp__
#define __invdyn_task_actuation_bounds_hpp__

#include <tsid/tasks/task-actuation.hpp>
#include <tsid/trajectories/trajectory-base.hpp>
#include <tsid/math/constraint-inequality.hpp>
24

jcarpent's avatar
jcarpent committed
25
namespace tsid
26
27
28
{
  namespace tasks
  {
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

    class TaskActuationBounds : public TaskActuation
    {
    public:
      EIGEN_MAKE_ALIGNED_OPERATOR_NEW

      typedef math::Index Index;
      typedef trajectories::TrajectorySample TrajectorySample;
      typedef math::Vector Vector;
      typedef math::VectorXi VectorXi;
      typedef math::ConstraintInequality ConstraintInequality;
      typedef pinocchio::Data Data;

      TaskActuationBounds(const std::string & name,
                          RobotWrapper & robot);

      int dim() const;

      const ConstraintBase & compute(const double t,
                                     ConstRefVector q,
                                     ConstRefVector v,
                                     const Data & data);

      const ConstraintBase & getConstraint() const;

      void setBounds(ConstRefVector lower, ConstRefVector upper);
      const Vector & getLowerBounds() const;
      const Vector & getUpperBounds() const;

      const Vector & mask() const;
      void mask(const Vector & mask);

    protected:
      Vector m_mask;
      VectorXi m_activeAxes;
      ConstraintInequality m_constraint;
    };

67
68
69
  }
}

70
#endif // ifndef __invdyn_task_actuation_bounds_hpp__