Skip to content
GitLab
Menu
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
9c2f0c0a
Commit
9c2f0c0a
authored
Jul 24, 2016
by
jcarpent
Browse files
[C++] Move operator== to the JointModelBase class
parent
536a9217
Changes
13
Hide whitespace changes
Inline
Side-by-side
src/multibody/joint/joint-base.hpp
View file @
9c2f0c0a
...
...
@@ -386,7 +386,17 @@ namespace se3
std
::
string
shortname
()
const
{
return
derived
().
shortname
();
}
static
std
::
string
classname
()
{
return
Derived
::
classname
();
}
template
<
class
OtherDerived
>
bool
operator
==
(
const
JointModelBase
<
OtherDerived
>
&
other
)
const
{
return
derived
().
isEqual
(
other
);
}
template
<
class
OtherDerived
>
bool
isEqual
(
const
JointModelBase
<
OtherDerived
>
&
)
const
{
return
false
;
}
bool
isEqual
(
const
JointModelBase
<
Derived
>
&
other
)
const
{
return
other
.
id
()
==
id
()
&&
other
.
idx_q
()
==
idx_q
()
&&
other
.
idx_v
()
==
idx_v
();
}
/* Acces to dedicated segment in robot config space. */
// Const access
...
...
@@ -420,7 +430,6 @@ namespace se3
typename
SizeDepType
<
NV
>::
template
SegmentReturn
<
D
>
::
Type
jointVelocitySelector_impl
(
Eigen
::
MatrixBase
<
D
>&
a
)
const
{
return
a
.
template
segment
<
NV
>(
i_v
);
}
template
<
typename
D
>
typename
SizeDepType
<
NV
>::
template
ColsReturn
<
D
>
::
ConstType
jointCols
(
const
Eigen
::
MatrixBase
<
D
>&
A
)
const
{
return
derived
().
jointCols_impl
(
A
);
}
...
...
src/multibody/joint/joint-dense.hpp
View file @
9c2f0c0a
...
...
@@ -241,19 +241,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelDense"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelDense
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelDense
template
<
>
...
...
src/multibody/joint/joint-free-flyer.hpp
View file @
9c2f0c0a
...
...
@@ -390,18 +390,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelFreeFlyer"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelFreeFlyer
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelFreeFlyer
}
// namespace se3
...
...
src/multibody/joint/joint-planar.hpp
View file @
9c2f0c0a
...
...
@@ -443,18 +443,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelPlanar"
);}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelPlanar
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelPlanar
}
// namespace se3
...
...
src/multibody/joint/joint-prismatic-unaligned.hpp
View file @
9c2f0c0a
...
...
@@ -449,20 +449,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelPrismaticUnaligned"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelPrismaticUnaligned
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
public:
Vector3
axis
;
};
// struct JointModelPrismaticUnaligned
...
...
src/multibody/joint/joint-prismatic.hpp
View file @
9c2f0c0a
...
...
@@ -504,18 +504,6 @@ namespace se3
static
std
::
string
classname
();
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelPrismatic
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelPrismatic
typedef
JointPrismatic
<
0
>
JointPX
;
...
...
src/multibody/joint/joint-revolute-unaligned.hpp
View file @
9c2f0c0a
...
...
@@ -453,20 +453,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelRevoluteUnaligned"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelRevoluteUnaligned
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
public:
Motion
::
Vector3
axis
;
};
// struct JointModelRevoluteUnaligned
...
...
src/multibody/joint/joint-revolute-unbounded.hpp
View file @
9c2f0c0a
...
...
@@ -254,19 +254,6 @@ namespace se3
static
std
::
string
classname
();
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelRevoluteUnbounded
<
axis
>
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelRevoluteUnbounded
typedef
JointRevoluteUnbounded
<
0
>
JointRUBX
;
...
...
src/multibody/joint/joint-revolute.hpp
View file @
9c2f0c0a
...
...
@@ -538,19 +538,6 @@ namespace se3
static
std
::
string
classname
();
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelRevolute
<
axis
>
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelRevolute
typedef
JointRevolute
<
0
>
JointRX
;
...
...
src/multibody/joint/joint-spherical-ZYX.hpp
View file @
9c2f0c0a
...
...
@@ -470,19 +470,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelSphericalZYX"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelSphericalZYX
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelSphericalZYX
}
// namespace se3
...
...
src/multibody/joint/joint-spherical.hpp
View file @
9c2f0c0a
...
...
@@ -415,18 +415,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelSpherical"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelSpherical
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelSpherical
}
// namespace se3
...
...
src/multibody/joint/joint-translation.hpp
View file @
9c2f0c0a
...
...
@@ -382,18 +382,6 @@ namespace se3
static
std
::
string
classname
()
{
return
std
::
string
(
"JointModelTranslation"
);
}
std
::
string
shortname
()
const
{
return
classname
();
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModelTranslation
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
};
// struct JointModelTranslation
}
// namespace se3
...
...
src/multibody/joint/joint.hpp
View file @
9c2f0c0a
...
...
@@ -90,8 +90,9 @@ namespace se3
typedef
Joint
JointDerived
;
SE3_JOINT_TYPEDEF
;
SE3_JOINT_USE_INDEXES
;
using
JointModelBase
<
JointModel
>::
id
;
using
JointModelBase
<
JointModel
>::
setIndexes
;
using
Base
::
id
;
using
Base
::
setIndexes
;
using
Base
::
operator
==
;
JointModelVariant
&
toVariant
()
{
return
*
static_cast
<
JointModelVariant
*>
(
this
);
}
const
JointModelVariant
&
toVariant
()
const
{
return
*
static_cast
<
const
JointModelVariant
*>
(
this
);
}
...
...
@@ -159,20 +160,6 @@ namespace se3
std
::
string
shortname
()
const
{
return
::
se3
::
shortname
(
*
this
);
}
static
std
::
string
classname
()
{
return
"JointModel"
;
}
template
<
class
D
>
bool
operator
==
(
const
JointModelBase
<
D
>
&
)
const
{
return
false
;
}
bool
operator
==
(
const
JointModelBase
<
JointModel
>
&
jmodel
)
const
{
return
jmodel
.
id
()
==
id
()
&&
jmodel
.
idx_q
()
==
idx_q
()
&&
jmodel
.
idx_v
()
==
idx_v
();
}
int
nq_impl
()
const
{
return
::
se3
::
nq
(
*
this
);
}
int
nv_impl
()
const
{
return
::
se3
::
nv
(
*
this
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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