Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
91d0bda3
Verified
Commit
91d0bda3
authored
Apr 29, 2021
by
Justin Carpentier
Browse files
multibody/joint-generic: fix comparison operators
parent
2aeb6770
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/multibody/joint/joint-generic.hpp
View file @
91d0bda3
//
// Copyright (c) 2016-202
0
CNRS INRIA
// Copyright (c) 2016-202
1
CNRS INRIA
//
#ifndef __pinocchio_joint_generic_hpp__
...
...
@@ -128,10 +128,20 @@ namespace pinocchio
static
std
::
string
classname
()
{
return
"JointData"
;
}
std
::
string
shortname
()
const
{
return
::
pinocchio
::
shortname
(
*
this
);
}
template
<
typename
JointDataDerived
>
bool
isEqual
(
const
JointDataBase
<
JointDataDerived
>
&
other
)
const
{
return
::
pinocchio
::
isEqual
(
other
.
derived
());
}
bool
isEqual
(
const
JointDataTpl
&
other
)
const
{
return
Base
::
isEqual
(
other
)
&&
toVariant
()
==
other
.
toVariant
();
return
Base
::
isEqual
(
other
)
&&
toVariant
()
==
other
.
toVariant
();
}
bool
operator
==
(
const
JointDataTpl
&
other
)
const
{
return
isEqual
(
other
);
}
};
...
...
@@ -191,11 +201,26 @@ namespace pinocchio
JointDataDerived
createData
()
const
{
return
::
pinocchio
::
createData
<
Scalar
,
Options
,
JointCollectionTpl
>
(
*
this
);
}
using
Base
::
isEqual
;
template
<
typename
JointModelDerived
>
bool
isEqual
(
const
JointModelBase
<
JointModelDerived
>
&
other
)
const
{
return
Base
::
hasSameIndexes
(
other
.
derived
())
&&
::
pinocchio
::
isEqual
(
*
this
,
other
.
derived
());;
}
bool
isEqual
(
const
JointModelTpl
&
other
)
const
{
return
Base
::
isEqual
(
other
)
&&
toVariant
()
==
other
.
toVariant
();
return
Base
::
isEqual
(
other
)
&&
toVariant
()
==
other
.
toVariant
();
}
bool
operator
==
(
const
JointModelTpl
&
other
)
const
{
return
isEqual
(
other
);
}
bool
operator
!=
(
const
JointModelTpl
&
other
)
const
{
return
!
(
*
this
==
other
);
}
template
<
typename
ConfigVector
>
...
...
@@ -225,7 +250,9 @@ namespace pinocchio
JointIndex
id_impl
()
const
{
return
::
pinocchio
::
id
(
*
this
);
}
void
setIndexes
(
JointIndex
id
,
int
nq
,
int
nv
)
{
::
pinocchio
::
setIndexes
(
*
this
,
id
,
nq
,
nv
);
}
{
::
pinocchio
::
setIndexes
(
*
this
,
id
,
nq
,
nv
);
}
/// \returns An expression of *this with the Scalar type casted to NewScalar.
template
<
typename
NewScalar
>
...
...
@@ -238,6 +265,28 @@ namespace pinocchio
typedef
PINOCCHIO_ALIGNED_STD_VECTOR
(
JointData
)
JointDataVector
;
typedef
PINOCCHIO_ALIGNED_STD_VECTOR
(
JointModel
)
JointModelVector
;
template
<
typename
Scalar
,
int
Options
=
0
,
template
<
typename
S
,
int
O
>
class
JointCollectionTpl
,
typename
JointDataDerived
>
bool
operator
==
(
const
JointDataBase
<
JointDataDerived
>
&
joint_data
,
const
JointDataTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
joint_data_generic
)
{
return
joint_data_generic
==
joint_data
.
derived
();
}
template
<
typename
Scalar
,
int
Options
=
0
,
template
<
typename
S
,
int
O
>
class
JointCollectionTpl
,
typename
JointModelDerived
>
bool
operator
==
(
const
JointModelBase
<
JointModelDerived
>
&
joint_model
,
const
JointModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
joint_model_generic
)
{
return
joint_model_generic
==
joint_model
.
derived
();
}
template
<
typename
Scalar
,
int
Options
=
0
,
template
<
typename
S
,
int
O
>
class
JointCollectionTpl
,
typename
JointModelDerived
>
bool
operator
!=
(
const
JointModelBase
<
JointModelDerived
>
&
joint_model
,
const
JointModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
joint_model_generic
)
{
return
joint_model_generic
!=
joint_model
.
derived
();
}
}
// namespace pinocchio
#endif // ifndef __pinocchio_joint_generic_hpp__
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment