Giter VIP home page Giter VIP logo

Comments (7)

vikashplus avatar vikashplus commented on June 15, 2024

Here are a few other signals I have

  1. 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.

vikashplus avatar vikashplus commented on June 15, 2024
  1. 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.

vikashplus avatar vikashplus commented on June 15, 2024
  1. For some models, the saved models(right) are different than the original models(left).
image image

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 15, 2024

@vikashplus i suspect these are different bugs. Can you try to make a MRE of the second bug please? Thanks.

from mujoco.

vikashplus avatar vikashplus commented on June 15, 2024

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.

yuvaltassa avatar yuvaltassa commented on June 15, 2024

@vikashplus these are 3 separate bugs (it's not helpful that they are described in the same issue).

  1. Will be fixed shortly.
  2. Will be fixed shortly. A workaround for now is to add None mujoco.mj_saveModel(mjc_model, filename, None) .
  3. We need a MRE for this.

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 15, 2024
  1. was fixed by 4b6c07c
  2. was fixed by 2b49758
  3. We need an MRE.

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.