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
Guilhem Saurel
ndcurves
Commits
ac1bd01d
Commit
ac1bd01d
authored
Nov 25, 2019
by
Pierre Fernbach
Committed by
Pierre Fernbach
Nov 29, 2019
Browse files
[Tests] WIP : add (failing) unit test for serialization of SO3Linear
parent
7bc446a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/Main.cpp
View file @
ac1bd01d
...
...
@@ -1680,6 +1680,30 @@ void so3LinearTest(bool& error) {
}
}
void
SO3serializationTest
(
bool
&
error
){
std
::
string
fileName
(
"fileTest"
);
std
::
string
errmsg
(
"SO3serializationTest : curve serialized is not equivalent to the original curve."
);
quaternion_t
q0
(
0.544
,
-
0.002
,
-
0.796
,
0.265
);
quaternion_t
q1
(
0.7071
,
0.7071
,
0
,
0
);
SO3Linear_t
so3Traj
(
q0
,
q1
,
0.5
,
2.2
);
so3Traj
.
saveAsText
<
SO3Linear_t
>
(
fileName
+
".txt"
);
SO3Linear_t
so3_from_txt
;
so3_from_txt
.
loadFromText
<
SO3Linear_t
>
(
fileName
+
".txt"
);
CompareCurves
<
SO3Linear_t
,
SO3Linear_t
>
(
so3Traj
,
so3_from_txt
,
errmsg
+
" For text serialization"
,
error
,
1e-3
);
// approximations comes from the conversions quaternion->matrix->quaternion
so3Traj
.
saveAsXML
<
SO3Linear_t
>
(
fileName
+
".xml"
,
"so3Curve"
);
SO3Linear_t
so3_from_xml
;
so3_from_xml
.
loadFromXML
<
SO3Linear_t
>
(
fileName
+
".xml"
,
"so3Curve"
);
CompareCurves
<
SO3Linear_t
,
SO3Linear_t
>
(
so3Traj
,
so3_from_xml
,
errmsg
+
" For XML serialization"
,
error
,
1e-3
);
so3Traj
.
saveAsBinary
<
SO3Linear_t
>
(
fileName
);
SO3Linear_t
so3_from_binary
;
so3_from_binary
.
loadFromBinary
<
SO3Linear_t
>
(
fileName
);
CompareCurves
<
SO3Linear_t
,
SO3Linear_t
>
(
so3Traj
,
so3_from_binary
,
errmsg
+
" For binary serialization"
,
error
,
1e-3
);
}
void
se3CurveTest
(
bool
&
error
)
{
quaternion_t
q0
(
1
,
0
,
0
,
0
);
quaternion_t
q1
(
0.
,
1.
,
0
,
0
);
...
...
@@ -2230,6 +2254,7 @@ int main(int /*argc*/, char** /*argv[]*/) {
serializationCurvesTest
(
error
);
polynomialFromBoundaryConditions
(
error
);
so3LinearTest
(
error
);
SO3serializationTest
(
error
);
se3CurveTest
(
error
);
BezierLinearProblemsetup_control_pointsNoConstraint
(
error
);
BezierLinearProblemsetup_control_pointsVarCombinatorialInit
(
error
);
...
...
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