src
math
constraint-base.cpp
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
#include <
tsid/math/constraint-base.hpp
>
19
20
using namespace
tsid::math
;
21
22
ConstraintBase::ConstraintBase
(
const
std::string&
name
) : m_name(
name
) {}
23
24
ConstraintBase::ConstraintBase
(
const
std::string&
name
,
const
unsigned
int
rows,
25
const
unsigned
int
cols)
26
: m_name(
name
) {
27
m_A
= Matrix::Zero(
rows
,
cols
);
28
}
29
30
ConstraintBase::ConstraintBase
(
const
std::string&
name
,
ConstRefMatrix
A
)
31
: m_name(
name
), m_A(
A
) {}
32
33
const
std::string&
ConstraintBase::name
()
const
{
return
m_name
; }
34
35
const
Matrix
&
ConstraintBase::matrix
()
const
{
return
m_A
; }
36
37
Matrix
&
ConstraintBase::matrix
() {
return
m_A
; }
38
39
bool
ConstraintBase::setMatrix
(
ConstRefMatrix
A
) {
40
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
m_A
.cols() ==
A
.cols(),
41
"cols do not match the constraint dimension"
);
42
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
m_A
.rows() ==
A
.rows(),
43
"rows do not match the constraint dimension"
);
44
m_A
=
A
;
45
return
true
;
46
}
ex_4_plan_LIPM_romeo.A
A
Definition:
ex_4_plan_LIPM_romeo.py:110
PINOCCHIO_CHECK_INPUT_ARGUMENT
#define PINOCCHIO_CHECK_INPUT_ARGUMENT(...)
tsid::math::ConstraintBase::m_A
Matrix m_A
Definition:
constraint-base.hpp:75
tsid::math::ConstraintBase::ConstraintBase
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstraintBase(const std::string &name)
Definition:
constraint-base.cpp:22
tsid::math::ConstraintBase::name
virtual const std::string & name() const
Definition:
constraint-base.cpp:33
tsid::math
Definition:
constraint-base.hpp:26
tsid::math::ConstraintBase::matrix
virtual const Matrix & matrix() const
Definition:
constraint-base.cpp:35
tsid::math::Matrix
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition:
math/fwd.hpp:36
constraint-base.hpp
tsid::math::ConstraintBase::cols
virtual unsigned int cols() const =0
setup.name
name
Definition:
setup.in.py:179
tsid::math::ConstraintBase::rows
virtual unsigned int rows() const =0
tsid::math::ConstRefMatrix
const typedef Eigen::Ref< const Matrix > ConstRefMatrix
Definition:
math/fwd.hpp:51
tsid::math::ConstraintBase::m_name
std::string m_name
Definition:
constraint-base.hpp:74
tsid::math::ConstraintBase::setMatrix
virtual bool setMatrix(ConstRefMatrix A)
Definition:
constraint-base.cpp:39
tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sat May 3 2025 02:48:16