Comments (7)
Here are a few other signals I have
- There is a bug while saving XMLs with frames
original model
<mujoco model="good">
<worldbody>
<geom type="plane" size=".1 .1 1"/>
<body name="root" pos="0 0 .5">
<geom type="sphere" size=".01" rgba="1 0 0 1"/>
<joint name="slide1" type="slide" limited="true" range="-1 1" actuatorfrclimited="false"/>
<frame name="fr1" pos="0 0 .01">
<geom name="geom_fr1" type="sphere" size=".01" rgba="1 1 0 1"/>
</frame>
<frame name="fr2" pos="0 0 -.01">
<geom name="geom_fr2" type="sphere" size=".01" rgba="1 1 0 1"/>
</frame>
</body>
</worldbody>
</mujoco>
Loading and saving the model using following with break the model due to difference in frame names
mjc_model = mujoco.MjModel.from_xml_path(model_path)
mujoco.mj_saveLastXML(model_save_path, mjc_model)
model = mujoco.MjModel.from_xml_path(model_save_path)
Saved model (bug)
<mujoco model="bug">
<worldbody>
<geom type="plane" size=".1 .1 1"/>
<body name="root" pos="0 0 .5">
<geom type="sphere" size=".01" rgba="1 0 0 1"/>
<joint name="slide1" type="slide" limited="true" range="-1 1" actuatorfrclimited="false"/>
<frame name="root" pos="0 0 .01">
<geom name="geom_fr1" type="sphere" size=".01" rgba="1 1 0 1"/>
</frame>
<frame name="root" pos="0 0 -.01">
<geom name="geom_fr2" type="sphere" size=".01" rgba="1 1 0 1"/>
</frame>
</body>
</worldbody>
</mujoco>
from mujoco.
- There is a bug while saving binary models
mjc_model = mujoco.MjModel.from_xml_path(model_path)
mujoco.mj_saveModel(mjc_model, model_path[:-4]+"_saved.mjb")
from mujoco.
- For some models, the saved models(right) are different than the original models(left).
![image](https://private-user-images.githubusercontent.com/12837145/322978251-9f7f29dc-8789-446c-aa18-362d38c7b9e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU4OTExODYsIm5iZiI6MTcxNTg5MDg4N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aXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxOTJiMTg1NmFhNmFiNzFmNTVlZGQ2NTgwN2MyMjAxNjRkOGNhYTA2MTgxNGRlZjg3YTg4NGM1MTI2NzliZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.22Gaz2-CUTkCOIwY1CQj-DMGfvL2CXBXkvWyGh82hH8)
from mujoco.
@vikashplus i suspect these are different bugs. Can you try to make a MRE of the second bug please? Thanks.
from mujoco.
Sure thing. Any model.xml will throw this one. Here is MRE
<mujoco model="bug">
<worldbody>
<geom type="plane" size=".1 .1 1"/>
<body name="root" pos="0 0 .5">
<geom type="sphere" size=".01" rgba="1 0 0 1"/>
<joint name="slide1" type="slide" limited="true" range="-1 1" actuatorfrclimited="false"/>
</body>
</worldbody>
</mujoco>
model_path="test.xml"
model_save_path = model_path[:-4]+"_saved"+model_path[-4:]
mjc_model = mujoco.MjModel.from_xml_path(model_path)
mujoco.mj_saveModel(mjc_model, model_path[:-4]+"_saved.mjb") # throws error
python test.py
Traceback (most recent call last):
File "test.py", line 10, in <module>
mujoco.mj_saveModel(mjc_model, model_path[:-4]+"_saved.mjb")
TypeError: mj_saveModel(): incompatible function arguments. The following argument types are supported:
1. (m: mujoco._structs.MjModel, filename: Optional[str], buffer: Optional[numpy.ndarray[numpy.uint8[m, 1], flags.writeable]]) -> None
Invoked with: <mujoco._structs.MjModel object at 0x10393de30>, 'test_saved.mjb'
from mujoco.
@vikashplus these are 3 separate bugs (it's not helpful that they are described in the same issue).
- Will be fixed shortly.
- Will be fixed shortly. A workaround for now is to add None
mujoco.mj_saveModel(mjc_model, filename, None)
. - We need a MRE for this.
from mujoco.
Closing this issue. @HappyLamb123, @vikashplus: if your issue is not resolved at head (i.e. please build from source and check), please open an new issue with a Minimum Reproducible Example.
from mujoco.
Related Issues (20)
- Understanding the relationship between body frame and inertial properties. HOT 1
- anisotropic bending stiffness for cable
- Using the replicate tag on a rangefinder sensor to simulate a LIDAR HOT 2
- [MJX] Model mesh_vert no longer jax array HOT 4
- mujoco display irregularity HOT 2
- Flex getting/setting position/velocity of each vertex HOT 3
- Custom GLContext python ?
- Hand-E Robotiq Gripper in MuJoCo - Control of Position and Force HOT 5
- Best practices for automated testing in downstream libraries? HOT 2
- Gradient of MJX simulation HOT 5
- Registering a New Custom SDF HOT 1
- Linking Python Bindings Code HOT 2
- Jittery/unstable contacts for a simple STL file of a box resting on a plane? HOT 2
- Actuator force visualization HOT 5
- mj_forward modifies jacobian when called after mj_step HOT 3
- Bouncing in MJX HOT 1
- I have a question about the friction force experiment. HOT 2
- mjx.put_data() and mjx.put_model() takes lot of time to resolve HOT 2
- Improved MuJoCo Simulation Scaling HOT 1
- Camera rendering in MuJoCo - How to take a picture from a simulated camera and still keeping the GUI active
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 mujoco.