Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-manipulation
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
Humanoid Path Planner
hpp-manipulation
Commits
497a4151
Commit
497a4151
authored
4 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
[Serialization] add ConnectedComponent
parent
0f2ea63d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/hpp/manipulation/connected-component.hh
+4
-1
4 additions, 1 deletion
include/hpp/manipulation/connected-component.hh
include/hpp/manipulation/serialization.hh
+1
-1
1 addition, 1 deletion
include/hpp/manipulation/serialization.hh
src/serialization.cc
+23
-3
23 additions, 3 deletions
src/serialization.cc
with
28 additions
and
5 deletions
include/hpp/manipulation/connected-component.hh
+
4
−
1
View file @
497a4151
...
...
@@ -55,8 +55,11 @@ class HPP_MANIPULATION_DLLAPI ConnectedComponent : public core::ConnectedCompone
private
:
bool
check
()
const
;
GraphStates_t
graphStateMap_
;
RoadmapPtr_t
roadmap_
;
// a RoadmapWkPtr_t so that memory can be released ?
RoadmapWkPtr_t
roadmap_
;
static
RoadmapNodes_t
empty_
;
HPP_SERIALIZABLE
();
};
// class ConnectedComponent
}
// namespace manipulation
}
// namespace hpp
...
...
This diff is collapsed.
Click to expand it.
include/hpp/manipulation/serialization.hh
+
1
−
1
View file @
497a4151
...
...
@@ -42,7 +42,7 @@ struct archive_graph_wrapper {
}
// namespace hpp
BOOST_CLASS_EXPORT_KEY
(
hpp
::
manipulation
::
RoadmapNode
)
BOOST_CLASS_EXPORT_KEY
(
hpp
::
manipulation
::
Leaf
ConnectedComp
)
BOOST_CLASS_EXPORT_KEY
(
hpp
::
manipulation
::
ConnectedComp
onent
)
BOOST_CLASS_EXPORT_KEY
(
hpp
::
manipulation
::
WeighedLeafConnectedComp
)
BOOST_CLASS_EXPORT_KEY
(
hpp
::
manipulation
::
Roadmap
)
...
...
This diff is collapsed.
Click to expand it.
src/serialization.cc
+
23
−
3
View file @
497a4151
...
...
@@ -24,13 +24,14 @@
#include
<pinocchio/serialization/eigen.hpp>
#include
<hpp/util/serialization.hh>
#include
<hpp/manipulation/device.hh>
#include
<hpp/manipulation/leaf-connected-comp.hh>
#include
<hpp/manipulation/roadmap-node.hh>
#include
<hpp/manipulation/roadmap.hh>
#include
<hpp/manipulation/serialization.hh>
BOOST_CLASS_EXPORT_IMPLEMENT
(
hpp
::
manipulation
::
RoadmapNode
)
BOOST_CLASS_EXPORT_IMPLEMENT
(
hpp
::
manipulation
::
Leaf
ConnectedComp
)
BOOST_CLASS_EXPORT_IMPLEMENT
(
hpp
::
manipulation
::
ConnectedComp
onent
)
BOOST_CLASS_EXPORT_IMPLEMENT
(
hpp
::
manipulation
::
WeighedLeafConnectedComp
)
BOOST_CLASS_EXPORT_IMPLEMENT
(
hpp
::
manipulation
::
Roadmap
)
...
...
@@ -49,6 +50,24 @@ inline void RoadmapNode::serialize(Archive& ar, const unsigned int version)
}
HPP_SERIALIZATION_IMPLEMENT
(
RoadmapNode
);
template
<
typename
Archive
>
inline
void
ConnectedComponent
::
serialize
(
Archive
&
ar
,
const
unsigned
int
version
)
{
using
namespace
boost
::
serialization
;
(
void
)
version
;
ar
&
make_nvp
(
"base"
,
base_object
<
core
::
ConnectedComponent
>
(
*
this
));
ar
&
BOOST_SERIALIZATION_NVP
(
roadmap_
);
if
(
!
Archive
::
is_saving
::
value
)
{
RoadmapPtr_t
roadmap
=
roadmap_
.
lock
();
for
(
const
core
::
NodePtr_t
&
node
:
nodes
())
{
const
RoadmapNodePtr_t
&
n
=
static_cast
<
const
RoadmapNodePtr_t
>
(
node
);
graphStateMap_
[
roadmap
->
getState
(
n
)].
push_back
(
n
);
}
}
//ar & BOOST_SERIALIZATION_NVP(graphStateMap_);
}
HPP_SERIALIZATION_IMPLEMENT
(
ConnectedComponent
);
template
<
typename
Archive
>
inline
void
LeafConnectedComp
::
serialize
(
Archive
&
ar
,
const
unsigned
int
version
)
{
...
...
@@ -81,11 +100,12 @@ inline void Roadmap::serialize(Archive& ar, const unsigned int version)
{
using
namespace
boost
::
serialization
;
(
void
)
version
;
// Must deserialize the graph before the connected components (so the base class).
ar
&
BOOST_SERIALIZATION_NVP
(
graph_
);
ar
&
BOOST_SERIALIZATION_NVP
(
weak_
);
ar
&
make_nvp
(
"base"
,
base_object
<
core
::
Roadmap
>
(
*
this
));
//ar & BOOST_SERIALIZATION_NVP(histograms_);
ar
&
BOOST_SERIALIZATION_NVP
(
graph_
);
ar
&
BOOST_SERIALIZATION_NVP
(
leafCCs_
);
ar
&
BOOST_SERIALIZATION_NVP
(
weak_
);
}
HPP_SERIALIZATION_IMPLEMENT
(
Roadmap
);
...
...
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