Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
coal
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
Coal
coal
Commits
055def9b
Verified
Commit
055def9b
authored
1 year ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
serialization/octree: fix pointer case handling
parent
115b812a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/hpp/fcl/serialization/octree.h
+10
-26
10 additions, 26 deletions
include/hpp/fcl/serialization/octree.h
with
10 additions
and
26 deletions
include/hpp/fcl/serialization/octree.h
+
10
−
26
View file @
055def9b
...
@@ -26,6 +26,13 @@ struct OcTreeAccessor : hpp::fcl::OcTree {
...
@@ -26,6 +26,13 @@ struct OcTreeAccessor : hpp::fcl::OcTree {
};
};
}
// namespace internal
}
// namespace internal
template
<
class
Archive
>
void
save_construct_data
(
Archive
&
ar
,
const
hpp
::
fcl
::
OcTree
*
octree_ptr
,
const
unsigned
int
/*version*/
)
{
const
double
resolution
=
octree_ptr
->
getResolution
();
ar
<<
make_nvp
(
"resolution"
,
resolution
);
}
template
<
class
Archive
>
template
<
class
Archive
>
void
save
(
Archive
&
ar
,
const
hpp
::
fcl
::
OcTree
&
octree
,
void
save
(
Archive
&
ar
,
const
hpp
::
fcl
::
OcTree
&
octree
,
const
unsigned
int
/*version*/
)
{
const
unsigned
int
/*version*/
)
{
...
@@ -37,9 +44,6 @@ void save(Archive &ar, const hpp::fcl::OcTree &octree,
...
@@ -37,9 +44,6 @@ void save(Archive &ar, const hpp::fcl::OcTree &octree,
const
std
::
string
stream_str
=
stream
.
str
();
const
std
::
string
stream_str
=
stream
.
str
();
ar
<<
make_nvp
(
"tree_data"
,
stream_str
);
ar
<<
make_nvp
(
"tree_data"
,
stream_str
);
// const double resolution = octree.getResolution();
// ar << make_nvp("resolution", resolution);
ar
<<
make_nvp
(
"base"
,
base_object
<
hpp
::
fcl
::
CollisionGeometry
>
(
octree
));
ar
<<
make_nvp
(
"base"
,
base_object
<
hpp
::
fcl
::
CollisionGeometry
>
(
octree
));
ar
<<
make_nvp
(
"default_occupancy"
,
access
.
default_occupancy
);
ar
<<
make_nvp
(
"default_occupancy"
,
access
.
default_occupancy
);
ar
<<
make_nvp
(
"occupancy_threshold"
,
access
.
occupancy_threshold
);
ar
<<
make_nvp
(
"occupancy_threshold"
,
access
.
occupancy_threshold
);
...
@@ -49,26 +53,9 @@ void save(Archive &ar, const hpp::fcl::OcTree &octree,
...
@@ -49,26 +53,9 @@ void save(Archive &ar, const hpp::fcl::OcTree &octree,
template
<
class
Archive
>
template
<
class
Archive
>
void
load_construct_data
(
Archive
&
ar
,
hpp
::
fcl
::
OcTree
*
octree_ptr
,
void
load_construct_data
(
Archive
&
ar
,
hpp
::
fcl
::
OcTree
*
octree_ptr
,
const
unsigned
int
/*version*/
)
{
const
unsigned
int
/*version*/
)
{
std
::
string
stream_str
;
double
resolution
;
ar
>>
make_nvp
(
"tree_data"
,
stream_str
);
ar
>>
make_nvp
(
"resolution"
,
resolution
);
std
::
istringstream
stream
(
stream_str
);
new
(
octree_ptr
)
hpp
::
fcl
::
OcTree
(
resolution
);
octomap
::
AbstractOcTree
*
tree_raw_ptr
=
octomap
::
AbstractOcTree
::
read
(
stream
);
std
::
shared_ptr
<
const
octomap
::
OcTree
>
tree_ptr
(
dynamic_cast
<
octomap
::
OcTree
*>
(
tree_raw_ptr
));
new
(
octree_ptr
)
hpp
::
fcl
::
OcTree
(
tree_ptr
);
hpp
::
fcl
::
OcTree
&
octree
=
*
octree_ptr
;
typedef
internal
::
OcTreeAccessor
Accessor
;
Accessor
&
access
=
reinterpret_cast
<
Accessor
&>
(
octree
);
// double resolution;
// ar >> make_nvp("resolution", resolution);
ar
>>
make_nvp
(
"base"
,
base_object
<
hpp
::
fcl
::
CollisionGeometry
>
(
octree
));
ar
>>
make_nvp
(
"default_occupancy"
,
access
.
default_occupancy
);
ar
>>
make_nvp
(
"occupancy_threshold"
,
access
.
occupancy_threshold
);
ar
>>
make_nvp
(
"free_threshold"
,
access
.
free_threshold
);
}
}
template
<
class
Archive
>
template
<
class
Archive
>
...
@@ -85,9 +72,6 @@ void load(Archive &ar, hpp::fcl::OcTree &octree,
...
@@ -85,9 +72,6 @@ void load(Archive &ar, hpp::fcl::OcTree &octree,
access
.
tree
=
std
::
shared_ptr
<
const
octomap
::
OcTree
>
(
access
.
tree
=
std
::
shared_ptr
<
const
octomap
::
OcTree
>
(
dynamic_cast
<
octomap
::
OcTree
*>
(
new_tree
));
dynamic_cast
<
octomap
::
OcTree
*>
(
new_tree
));
// double resolution;
// ar >> make_nvp("resolution", resolution);
ar
>>
make_nvp
(
"base"
,
base_object
<
hpp
::
fcl
::
CollisionGeometry
>
(
octree
));
ar
>>
make_nvp
(
"base"
,
base_object
<
hpp
::
fcl
::
CollisionGeometry
>
(
octree
));
ar
>>
make_nvp
(
"default_occupancy"
,
access
.
default_occupancy
);
ar
>>
make_nvp
(
"default_occupancy"
,
access
.
default_occupancy
);
ar
>>
make_nvp
(
"occupancy_threshold"
,
access
.
occupancy_threshold
);
ar
>>
make_nvp
(
"occupancy_threshold"
,
access
.
occupancy_threshold
);
...
...
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