Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mujoco Py
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Jakob Hollenstein
Mujoco Py
Commits
da47d6c6
Commit
da47d6c6
authored
5 years ago
by
Bowen Baker
Committed by
Million Integrals
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delete xml after loading (#411)
parent
392c6e53
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mujoco_py/cymj.pyx
+2
-2
2 additions, 2 deletions
mujoco_py/cymj.pyx
with
2 additions
and
2 deletions
mujoco_py/cymj.pyx
+
2
−
2
View file @
da47d6c6
...
...
@@ -183,10 +183,10 @@ def load_model_from_xml(str xml_str):
cdef
char
errstr
[
300
]
cdef
mjModel
*
model
with
wrap_mujoco_warning
():
with
tempfile
.
NamedTemporaryFile
(
suffix
=
"
.xml
"
,
delete
=
Fals
e
)
as
fp
:
with
tempfile
.
NamedTemporaryFile
(
suffix
=
"
.xml
"
,
delete
=
Tru
e
)
as
fp
:
fp
.
write
(
xml_str
.
encode
())
fp
.
flush
()
model
=
mj_loadXML
(
fp
.
name
.
encode
(),
NULL
,
errstr
,
300
)
model
=
mj_loadXML
(
fp
.
name
.
encode
(),
NULL
,
errstr
,
300
)
if
model
==
NULL
:
raise
Exception
(
'
%s
\n
Failed to load XML from file: %s. mj_loadXML error: %s
'
%
(
xml_str
,
fp
.
name
,
errstr
,))
return
WrapMjModel
(
model
)
...
...
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