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
ffb17510
Verified
Commit
ffb17510
authored
Apr 29, 2021
by
Justin Carpentier
Browse files
test: enhance testing of operator{==,!=} for JointGeneric
parent
e726f025
Changes
1
Hide whitespace changes
Inline
Side-by-side
unittest/joint-generic.cpp
View file @
ffb17510
...
...
@@ -22,24 +22,46 @@ void test_joint_methods(JointModelBase<JointModel> & jmodel,
typedef
typename
LieGroup
<
JointModel
>::
type
LieGroupType
;
std
::
cout
<<
"Testing Joint over "
<<
jmodel
.
shortname
()
<<
std
::
endl
;
Eigen
::
VectorXd
q1
,
q2
;
Eigen
::
VectorXd
v1
(
Eigen
::
VectorXd
::
Random
(
jdata
.
S
().
nv
()));
Inertia
::
Matrix6
Ia
(
pinocchio
::
Inertia
::
Random
().
matrix
());
bool
update_I
=
false
;
q1
=
LieGroupType
().
random
();
q2
=
LieGroupType
().
random
();
Eigen
::
VectorXd
v1
(
Eigen
::
VectorXd
::
Random
(
jdata
.
S
().
nv
())),
v2
(
Eigen
::
VectorXd
::
Random
(
jdata
.
S
().
nv
()));
Inertia
::
Matrix6
Ia
(
pinocchio
::
Inertia
::
Random
().
matrix
()),
Ia2
(
pinocchio
::
Inertia
::
Random
().
matrix
());
bool
update_I
=
false
;
jmodel
.
calc
(
jdata
.
derived
(),
q1
,
v1
);
jmodel
.
calc_aba
(
jdata
.
derived
(),
Ia
,
update_I
);
pinocchio
::
JointModel
jma
(
jmodel
);
pinocchio
::
JointData
jda
(
jdata
.
derived
());
BOOST_CHECK
(
jmodel
==
jma
);
BOOST_CHECK
(
jma
==
jmodel
);
pinocchio
::
JointData
jda
(
jdata
);
BOOST_CHECK
(
jda
==
jdata
);
BOOST_CHECK
(
jdata
==
jda
);
jma
.
calc
(
jda
,
q1
,
v1
);
jma
.
calc_aba
(
jda
,
Ia
,
update_I
);
pinocchio
::
JointData
jda_other
(
jdata
);
jma
.
calc
(
jda_other
,
q2
,
v2
);
jma
.
calc_aba
(
jda_other
,
Ia2
,
update_I
);
BOOST_CHECK
(
jda_other
!=
jda
);
BOOST_CHECK
(
jda
!=
jda_other
);
BOOST_CHECK
(
jda_other
!=
jdata
);
BOOST_CHECK
(
jdata
!=
jda_other
);
std
::
string
error_prefix
(
"JointModel on "
+
jma
.
shortname
());
const
std
::
string
error_prefix
(
"JointModel on "
+
jma
.
shortname
());
BOOST_CHECK_MESSAGE
(
jmodel
.
nq
()
==
jma
.
nq
()
,
std
::
string
(
error_prefix
+
" - nq "
));
BOOST_CHECK_MESSAGE
(
jmodel
.
nv
()
==
jma
.
nv
()
,
std
::
string
(
error_prefix
+
" - nv "
));
...
...
@@ -316,10 +338,11 @@ BOOST_AUTO_TEST_CASE(isEqual)
jmodelx
.
setIndexes
(
0
,
0
,
0
);
JointModel
jmodelx_copy
=
jmodelx
;
BOOST_CHECK
(
jmodelx_copy
==
jmodelx
);
BOOST_CHECK
(
jmodelx_copy
==
jmodelx
.
derived
());
JointModel
jmodely
(
joint_revolutey
);
// T
D
DO: the comparison of two variants is not supported by some old version of BOOST
// T
O
DO: the comparison of two variants is not supported by some old version of BOOST
// BOOST_CHECK(jmodely.toVariant() != jmodelx.toVariant());
BOOST_CHECK
(
jmodely
!=
jmodelx
);
}
...
...
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