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
011ae2b6
Verified
Commit
011ae2b6
authored
Apr 28, 2021
by
Justin Carpentier
Browse files
test/algo: enforce testing of empty joint list for buildReducedModel
parent
f18f5ca2
Pipeline
#14223
passed with stage
in 121 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
unittest/model.cpp
View file @
011ae2b6
...
...
@@ -281,6 +281,39 @@ BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
}
#endif
BOOST_AUTO_TEST_CASE
(
test_buildReducedModel_empty
)
{
Model
humanoid_model
;
buildModels
::
humanoid
(
humanoid_model
);
static
const
std
::
vector
<
JointIndex
>
empty_index_vector
;
humanoid_model
.
lowerPositionLimit
.
head
<
3
>
().
fill
(
-
1.
);
humanoid_model
.
upperPositionLimit
.
head
<
3
>
().
fill
(
1.
);
humanoid_model
.
referenceConfigurations
.
insert
(
std
::
pair
<
std
::
string
,
Eigen
::
VectorXd
>
(
"neutral"
,
neutral
(
humanoid_model
)));
Eigen
::
VectorXd
reference_config_humanoid
=
randomConfiguration
(
humanoid_model
);
Model
humanoid_copy_model
=
buildReducedModel
(
humanoid_model
,
empty_index_vector
,
reference_config_humanoid
);
BOOST_CHECK
(
humanoid_copy_model
.
names
==
humanoid_model
.
names
);
BOOST_CHECK
(
humanoid_copy_model
.
joints
==
humanoid_model
.
joints
);
BOOST_CHECK
(
humanoid_copy_model
==
humanoid_model
);
BOOST_CHECK
(
humanoid_copy_model
.
referenceConfigurations
[
"neutral"
].
isApprox
(
neutral
(
humanoid_copy_model
)));
const
std
::
vector
<
JointIndex
>
empty_joints_to_lock
;
const
Model
reduced_humanoid_model
=
buildReducedModel
(
humanoid_model
,
empty_joints_to_lock
,
reference_config_humanoid
);
BOOST_CHECK
(
reduced_humanoid_model
.
njoints
==
humanoid_model
.
njoints
);
BOOST_CHECK
(
reduced_humanoid_model
.
frames
==
humanoid_model
.
frames
);
BOOST_CHECK
(
reduced_humanoid_model
.
jointPlacements
==
humanoid_model
.
jointPlacements
);
BOOST_CHECK
(
reduced_humanoid_model
.
joints
==
humanoid_model
.
joints
);
for
(
JointIndex
joint_id
=
1
;
joint_id
<
(
JointIndex
)
reduced_humanoid_model
.
njoints
;
++
joint_id
)
{
BOOST_CHECK
(
reduced_humanoid_model
.
inertias
[
joint_id
].
isApprox
(
humanoid_model
.
inertias
[
joint_id
]));
}
}
BOOST_AUTO_TEST_CASE
(
test_buildReducedModel
)
{
Model
humanoid_model
;
...
...
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