tsid  1.8.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
constraint-equality.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_math_constraint_equality_hpp__
19 #define __invdyn_math_constraint_equality_hpp__
20 
22 
23 namespace tsid {
24 namespace math {
25 
27  public:
28  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
29 
30  ConstraintEquality(const std::string& name);
31 
32  ConstraintEquality(const std::string& name, const unsigned int rows,
33  const unsigned int cols);
34 
35  ConstraintEquality(const std::string& name, ConstRefMatrix A,
36  ConstRefVector b);
37 
38  unsigned int rows() const override;
39  unsigned int cols() const override;
40  void resize(unsigned int r, unsigned int c) override;
41 
42  bool isEquality() const override;
43  bool isInequality() const override;
44  bool isBound() const override;
45 
46  const Vector& vector() const override;
47  const Vector& lowerBound() const override;
48  const Vector& upperBound() const override;
49 
50  Vector& vector() override;
51  Vector& lowerBound() override;
52  Vector& upperBound() override;
53 
54  bool setVector(ConstRefVector b) override;
55  bool setLowerBound(ConstRefVector lb) override;
56  bool setUpperBound(ConstRefVector ub) override;
57 
58  bool checkConstraint(ConstRefVector x, double tol = 1e-6) const override;
59 
60  protected:
62 };
63 
64 } // namespace math
65 } // namespace tsid
66 
67 #endif // ifndef __invdyn_math_constraint_equality_hpp__
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:35
virtual const std::string & name() const
Definition: constraint-base.cpp:33
Definition: constraint-equality.hpp:26
bool isEquality() const override
Definition: constraint-equality.cpp:51
bool setVector(ConstRefVector b) override
Definition: constraint-equality.cpp:75
bool isBound() const override
Definition: constraint-equality.cpp:53
const Vector & upperBound() const override
Definition: constraint-equality.cpp:60
const Vector & lowerBound() const override
Definition: constraint-equality.cpp:56
bool setLowerBound(ConstRefVector lb) override
Definition: constraint-equality.cpp:79
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstraintEquality(const std::string &name)
Definition: constraint-equality.cpp:22
const Vector & vector() const override
Definition: constraint-equality.cpp:55
bool setUpperBound(ConstRefVector ub) override
Definition: constraint-equality.cpp:83
unsigned int cols() const override
Definition: constraint-equality.cpp:42
void resize(unsigned int r, unsigned int c) override
Definition: constraint-equality.cpp:46
Vector m_b
Definition: constraint-equality.hpp:61
unsigned int rows() const override
Definition: constraint-equality.cpp:37
bool isInequality() const override
Definition: constraint-equality.cpp:52
bool checkConstraint(ConstRefVector x, double tol=1e-6) const override
Definition: constraint-equality.cpp:88
const Eigen::Ref< const Matrix > ConstRefMatrix
Definition: fwd.hpp:51
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:48
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:35
Definition: constraint-bound.hpp:25