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-pinocchio
Commits
12d667be
Commit
12d667be
authored
May 16, 2020
by
Joseph Mirabel
Browse files
Fix serialization of liegroup::VectorSpaceOperation<-1,...>
parent
1325ddfb
Changes
3
Show whitespace changes
Inline
Side-by-side
include/hpp/pinocchio/liegroup/serialization.hh
View file @
12d667be
...
...
@@ -24,37 +24,21 @@
namespace
boost
{
namespace
serialization
{
template
<
class
Archive
,
int
Size
,
bool
rot
>
inline
void
load
(
Archive
&
ar
,
hpp
::
pinocchio
::
liegroup
::
VectorSpaceOperation
<
Size
,
rot
>&
lg
,
const
unsigned
int
version
)
{
(
void
)
version
;
if
(
Size
==
Eigen
::
Dynamic
)
{
int
size
;
ar
&
make_nvp
(
"size"
,
size
);
lg
=
hpp
::
pinocchio
::
liegroup
::
VectorSpaceOperation
<
Size
,
rot
>
(
size
);
}
}
template
<
class
Archive
,
int
Size
,
bool
rot
>
inline
void
s
av
e
(
Archive
&
ar
,
const
hpp
::
pinocchio
::
liegroup
::
VectorSpaceOperation
<
Size
,
rot
>&
lg
,
inline
void
s
erializ
e
(
Archive
&
ar
,
hpp
::
pinocchio
::
liegroup
::
VectorSpaceOperation
<
Size
,
rot
>&
lg
,
const
unsigned
int
version
)
{
(
void
)
version
;
if
(
Size
==
Eigen
::
Dynamic
)
{
int
size
=
static_cast
<
int
>
(
lg
.
nq
());
ar
&
make_nvp
(
"size"
,
size
);
if
(
!
Archive
::
is_saving
::
value
)
{
// TODO VectorSpaceOperation should provide a resize operation.
lg
=
hpp
::
pinocchio
::
liegroup
::
VectorSpaceOperation
<
Size
,
rot
>
(
size
);
}
}
}
template
<
class
Archive
,
int
Size
,
bool
rot
>
inline
void
serialize
(
Archive
&
ar
,
hpp
::
pinocchio
::
liegroup
::
VectorSpaceOperation
<
Size
,
rot
>&
lg
,
const
unsigned
int
version
)
{
split_free
(
ar
,
lg
,
version
);
}
template
<
class
Archive
,
typename
LieGroup1
,
typename
LieGroup2
>
...
...
include/hpp/pinocchio/liegroup/vector-space.hh
View file @
12d667be
...
...
@@ -58,7 +58,7 @@ namespace hpp {
/// Constructor
/// \param size size of the vector space: should be the equal to
/// template argument for static sized vector-spaces.
VectorSpaceOperation
(
int
size
=
Siz
e
)
:
Base
(
size
)
VectorSpaceOperation
(
int
size
=
boost
::
static_signed_max
<
0
,
Size
>::
valu
e
)
:
Base
(
size
)
{
}
...
...
tests/liegroup-element.cc
View file @
12d667be
...
...
@@ -291,10 +291,9 @@ BOOST_AUTO_TEST_CASE (log_)
BOOST_CHECK
((
hpp
::
pinocchio
::
log
(
e
).
isZero
(
1e-10
)));
}
BOOST_AUTO_TEST_CASE
(
serialization
)
void
test_serialization
(
LiegroupSpacePtr_t
space
)
{
LiegroupSpacePtr_t
R6xSO3
(
LiegroupSpace
::
R3
()
*
LiegroupSpace
::
R3xSO3
());
LiegroupElement
e
(
R6xSO3
);
e
.
setNeutral
();
LiegroupElement
e
(
space
);
e
.
setNeutral
();
std
::
stringstream
ss
;
{
...
...
@@ -311,3 +310,19 @@ BOOST_AUTO_TEST_CASE (serialization)
BOOST_CHECK_EQUAL
(
*
e
.
space
(),
*
e2
.
space
());
BOOST_CHECK
(
e
.
vector
()
==
e2
.
vector
());
}
BOOST_AUTO_TEST_CASE
(
serialization
)
{
test_serialization
(
LiegroupSpace
::
R1
());
test_serialization
(
LiegroupSpace
::
R2
());
test_serialization
(
LiegroupSpace
::
R3
());
test_serialization
(
LiegroupSpace
::
Rn
(
4
));
test_serialization
(
LiegroupSpace
::
SO2
());
test_serialization
(
LiegroupSpace
::
SO3
());
test_serialization
(
LiegroupSpace
::
SE2
());
test_serialization
(
LiegroupSpace
::
SE3
());
test_serialization
(
LiegroupSpace
::
R2xSO2
());
test_serialization
(
LiegroupSpace
::
R3xSO3
());
test_serialization
(
LiegroupSpace
::
R3
()
*
LiegroupSpace
::
R3xSO3
());
test_serialization
(
LiegroupSpace
::
R3
()
*
LiegroupSpace
::
R3xSO3
());
}
Write
Preview
Markdown
is supported
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