Comments (2)
This is not a bug, but a somewhat annoying thing that pymjcf does for reasons that are not relevant here. You can do some post processing to remove them like:
from lxml import etree
print('Remove class="/".')
xml_string = model.to_xml_string('float', precision=3, zero_threshold=1e-7)
root = etree.XML(xml_string,
etree.XMLParser(remove_blank_text=True))
default_elem = root.find('default')
root.insert(3, default_elem[0])
root.remove(default_elem)
print('Remove hashes from filenames.')
meshes = [mesh for mesh in root.find('asset').iter() if mesh.tag == 'mesh']
for mesh in meshes:
name, extension = mesh.get('file').split('.')
mesh.set('file', '.'.join((name[:-41], extension)))
print('Get string from lxml.')
xml_string = etree.tostring(root, pretty_print=True)
xml_string = xml_string.replace(b' class="/"', b'')
from dm_control.
Alternatively use the function mjcf.export_with_assets(..)
:
mjcf.export_with_assets(torso.mjcf_model, self.mjcf_root, "mwe.xml")
That will not require any post processing, but will create duplicates of your mesh with the correct name in the specified folder.
from dm_control.
Related Issues (20)
- mjcf module incorrectly requires all plugin elements to have a name attribute
- Cannot reproduce the joining of parent and child models in "Attaching models" section of mjcf. HOT 1
- how can I find out information about which body part the observation belongs to? HOT 5
- Suite vectorized environments? HOT 1
- How to add a seed to custom environments? HOT 1
- flexcomp object cannot be created
- Unable to load an .xml with bodies which have "user" parameter using "mjcf.from_path()" HOT 4
- How to change the reset function?
- mjcf/schema.xml is missing eulerdamp as flag attribute HOT 1
- Headless rendering on Mac? HOT 2
- Error while trying to create a visualization HOT 1
- A small question about developing based on dm_control and mujoco HOT 1
- Which part of the library is the implementation of NEURAL PROBABILISTIC MOTOR PRIMITIVES FOR HUMANOID CONTROL?
- Do you have some official baseline of several traditional environments? such as SAC,TD3,DDPG,CURL etc?
- MJCF Parsing Error - Identifier Containing Separator HOT 4
- How can I access the angle of a specific joint in the walker model?
- PyMJCF Keyframe Help HOT 1
- Attachment frames's inertial property
- Removing dclass-attribute HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dm_control.