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
Stack Of Tasks
pinocchio
Commits
6329b46c
Verified
Commit
6329b46c
authored
Nov 23, 2019
by
Justin Carpentier
Browse files
python/model: simplify pickle loading
parent
225eff1e
Pipeline
#6931
passed with stage
in 195 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bindings/python/multibody/model.hpp
View file @
6329b46c
...
...
@@ -68,24 +68,18 @@ namespace pinocchio
}
bp
::
object
py_obj
=
tup
[
0
];
std
::
string
str
;
if
(
PyS
tring
_C
heck
(
py_obj
.
ptr
()
))
boost
::
python
::
extract
<
std
::
string
>
obj_as_string
(
py_obj
.
ptr
())
;
if
(
obj_as_s
tring
.
c
heck
())
{
str
=
PyString_AsString
(
py_obj
.
ptr
());
const
std
::
string
str
=
obj_as_string
;
model
.
loadFromString
(
str
);
}
else
{
boost
::
python
::
extract
<
std
::
string
>
obj_as_string
(
py_obj
.
ptr
());
if
(
obj_as_string
.
check
())
str
=
obj_as_string
;
else
{
throw
eigenpy
::
Exception
(
"Pickle was not able to reconstruct the model from the loaded data.
\n
"
"The entry is not a string."
);
}
throw
eigenpy
::
Exception
(
"Pickle was not able to reconstruct the model from the loaded data.
\n
"
"The entry is not a string."
);
}
model
.
loadFromString
(
str
);
}
};
...
...
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