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
Humanoid Path Planner
hpp-core
Commits
22ee3628
Commit
22ee3628
authored
May 18, 2019
by
Joseph Mirabel
Browse files
[Refactoring] Fix unit-tests
parent
7ed0d440
Changes
4
Hide whitespace changes
Inline
Side-by-side
tests/configuration-shooters.cc
View file @
22ee3628
...
...
@@ -33,13 +33,12 @@ namespace pin_test = hpp::pinocchio::unittest;
template
<
typename
CS_t
>
void
basic_test
(
CS_t
cs
,
DevicePtr_t
robot
)
{
hpp
::
core
::
Configuration_t
q
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
hpp
::
core
::
ConfigurationPtr_t
cptr
=
cs
->
shoot
();
BOOST_REQUIRE
(
cptr
);
hpp
::
core
::
Configuration_t
c
=
*
cptr
;
cs
->
shoot
(
q
);
hpp
::
pinocchio
::
ArrayXb
unused
(
robot
->
numberDof
());
BOOST_CHECK
(
!
hpp
::
pinocchio
::
saturate
(
robot
,
c
,
unused
));
BOOST_CHECK
(
!
hpp
::
pinocchio
::
saturate
(
robot
,
q
,
unused
));
}
}
...
...
@@ -61,5 +60,7 @@ BOOST_AUTO_TEST_CASE (gaussian)
cs
->
sigma
(
0
);
BOOST_CHECK
(
cs
->
shoot
()
->
isApprox
(
cs
->
center
()));
hpp
::
core
::
Configuration_t
q
;
cs
->
shoot
(
q
);
BOOST_CHECK
(
q
.
isApprox
(
cs
->
center
()));
}
tests/explicit-relative-transformation.cc
View file @
22ee3628
...
...
@@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE (two_freeflyers)
{
DevicePtr_t
robot
=
createRobot
();
BOOST_REQUIRE
(
robot
);
c
onfigurationShooter
::
Uniform
Ptr_t
cs
=
configurationShooter
::
Uniform
::
create
(
robot
);
C
onfigurationShooterPtr_t
cs
=
configurationShooter
::
Uniform
::
create
(
robot
);
JointPtr_t
object2
=
robot
->
getJointByName
(
"obj2/root_joint"
);
JointPtr_t
object1
=
robot
->
getJointByName
(
"obj1/root_joint"
);
...
...
@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE (two_frames_on_freeflyer)
{
DevicePtr_t
robot
=
createRobot
();
BOOST_REQUIRE
(
robot
);
c
onfigurationShooter
::
Uniform
Ptr_t
cs
=
configurationShooter
::
Uniform
::
create
(
robot
);
C
onfigurationShooterPtr_t
cs
=
configurationShooter
::
Uniform
::
create
(
robot
);
JointPtr_t
object2
=
robot
->
getJointByName
(
"obj2/root_joint"
);
JointPtr_t
object1
=
robot
->
getJointByName
(
"obj1/root_joint"
);
...
...
@@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE (compare_to_relative_transform)
{
DevicePtr_t
robot
=
createRobot
();
BOOST_REQUIRE
(
robot
);
c
onfigurationShooter
::
Uniform
Ptr_t
cs
=
configurationShooter
::
Uniform
::
create
(
robot
);
C
onfigurationShooterPtr_t
cs
=
configurationShooter
::
Uniform
::
create
(
robot
);
JointPtr_t
object2
=
robot
->
getJointByName
(
"obj2/root_joint"
);
JointPtr_t
object1
=
robot
->
getJointByName
(
"obj1/root_joint"
);
...
...
tests/roadmap-1.cc
View file @
22ee3628
...
...
@@ -369,7 +369,7 @@ BOOST_AUTO_TEST_CASE (nearestNeighbor) {
hpp
::
pinocchio
::
value_type
dist
;
using
hpp
::
core
::
Nodes_t
;
Nodes_t
knearest
=
r
->
nearestNeighbor
()
->
KnearestSearch
(
nodes
[
0
]
->
configuration
(),
nodes
[
0
]
->
connectedComponent
(),
3
,
dist
);
(
*
nodes
[
0
]
->
configuration
(),
nodes
[
0
]
->
connectedComponent
(),
3
,
dist
);
for
(
Nodes_t
::
const_iterator
it
=
knearest
.
begin
();
it
!=
knearest
.
end
();
++
it
)
{
BOOST_TEST_MESSAGE
(
"q = ["
<<
(
*
it
)
->
configuration
()
->
transpose
()
<<
"] - dist : "
<<
(
*
distance
)
(
*
nodes
[
0
]
->
configuration
(),
*
(
*
it
)
->
configuration
()));
}
...
...
tests/test-kinodynamic.cc
View file @
22ee3628
...
...
@@ -410,7 +410,7 @@ BOOST_AUTO_TEST_CASE (kinodynamic) {
// random tests with non null initial and final acceleration
c
onfigurationShooter
::
Uniform
Ptr_t
shooter
=
configurationShooter
::
Uniform
::
create
(
robot
);
C
onfigurationShooterPtr_t
shooter
=
configurationShooter
::
Uniform
::
create
(
robot
);
ConfigurationPtr_t
qr1
,
qr0
;
value_type
t1
,
t2
;
for
(
size_t
i
=
0
;
i
<
1000
;
i
++
){
...
...
@@ -607,7 +607,7 @@ BOOST_AUTO_TEST_CASE (kinodynamicOriented) {
PathValidationReportPtr_t
validationReport
;
PathPtr_t
validPath
;
c
onfigurationShooter
::
Uniform
Ptr_t
shooter
=
configurationShooter
::
Uniform
::
create
(
robot
);
C
onfigurationShooterPtr_t
shooter
=
configurationShooter
::
Uniform
::
create
(
robot
);
ConfigurationPtr_t
qr1
,
qr0
;
value_type
t1
,
t2
;
for
(
size_t
i
=
0
;
i
<
1000
;
i
++
){
...
...
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