Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
6eba5801
Commit
6eba5801
authored
8 years ago
by
Valenza Florian
Browse files
Options
Downloads
Patches
Plain Diff
[C++][unittest] Fix quaternion norm assertions by normalizing config vector
parent
c16b7c1b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittest/joint-composite.cpp
+4
-9
4 additions, 9 deletions
unittest/joint-composite.cpp
with
4 additions
and
9 deletions
unittest/joint-composite.cpp
+
4
−
9
View file @
6eba5801
...
...
@@ -48,9 +48,9 @@ void test_joint_methods (T & jmodel)
JointDataComposite
jdata_composite
=
jmodel_composite
.
createData
();
Eigen
::
VectorXd
q1
(
Eigen
::
VectorXd
::
Random
(
jmodel
.
nq
()));
Eigen
::
VectorXd
q1
(
Eigen
::
VectorXd
::
Random
(
jmodel
.
nq
()));
jmodel_composite
.
normalize
(
q1
);
Eigen
::
VectorXd
q1_dot
(
Eigen
::
VectorXd
::
Random
(
jmodel
.
nv
()));
Eigen
::
VectorXd
q2
(
Eigen
::
VectorXd
::
Random
(
jmodel
.
nq
()));
Eigen
::
VectorXd
q2
(
Eigen
::
VectorXd
::
Random
(
jmodel
.
nq
()));
jmodel_composite
.
normalize
(
q2
);
double
u
=
0.3
;
se3
::
Inertia
::
Matrix6
Ia
(
se3
::
Inertia
::
Random
().
matrix
());
bool
update_I
=
false
;
...
...
@@ -77,10 +77,9 @@ void test_joint_methods (T & jmodel)
,
std
::
string
(
error_prefix
+
" - RandomConfiguration dimensions "
));
BOOST_CHECK_MESSAGE
(
jmodel
.
difference
(
q1
,
q2
).
isApprox
(
jmodel_composite
.
difference
(
q1
,
q2
))
,
std
::
string
(
error_prefix
+
" - difference "
));
BOOST_CHECK_MESSAGE
(
jmodel
.
distance
(
q1
,
q2
)
==
jmodel_composite
.
distance
(
q1
,
q2
)
,
std
::
string
(
error_prefix
+
" - distance "
));
BOOST_CHECK_MESSAGE
(
fabs
(
jmodel
.
distance
(
q1
,
q2
)
-
jmodel_composite
.
distance
(
q1
,
q2
)
)
<=
1e-6
,
std
::
string
(
error_prefix
+
" - distance "
));
// pb call-operator car jdata directement le type derivé
// BOOST_CHECK_MESSAGE((jdata.S().matrix()).isApprox((jdata_composite.S().matrix())),std::string(error_prefix + " - ConstraintXd "));
BOOST_CHECK_MESSAGE
(((
ConstraintXd
)
jdata
.
S
).
matrix
().
isApprox
((
jdata_composite
.
S
.
matrix
())),
std
::
string
(
error_prefix
+
" - ConstraintXd "
));
BOOST_CHECK_MESSAGE
(
jdata
.
M
==
jdata_composite
.
M
,
std
::
string
(
error_prefix
+
" - Joint transforms "
));
// == or isApprox ?
BOOST_CHECK_MESSAGE
((
Motion
)
jdata
.
v
==
jdata_composite
.
v
,
std
::
string
(
error_prefix
+
" - Joint motions "
));
...
...
@@ -260,11 +259,7 @@ BOOST_AUTO_TEST_CASE ( test_R3xSO3)
Eigen
::
VectorXd
tau
(
Eigen
::
VectorXd
::
Random
(
model_zero_mass
.
nq
));
double
u
=
0.3
;
// Test that algorithms do not crash
integrate
(
model_composite
,
q
,
q_dot
);
interpolate
(
model_composite
,
q1
,
q2
,
u
);
differentiate
(
model_composite
,
q1
,
q2
);
distance
(
model_composite
,
q1
,
q2
);
aba
(
model_composite
,
data_composite
,
q
,
q_dot
,
tau
);
centerOfMass
(
model_composite
,
data_composite
,
q
,
q_dot
,
q_ddot
,
true
,
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment