Giter Site home page Giter Site logo

Load a mujoco xml file about raisimlib HOT 30 CLOSED

raisimtech avatar raisimtech commented on August 18, 2024
Load a mujoco xml file

from raisimlib.

Comments (30)

jhwangbo avatar jhwangbo commented on August 18, 2024

I'll put this one on my to-do list.

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

+1. Is there an estimate of when will this happen, as in how high up in the list is it? Would be great to have this feature!

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

I'll finish it by the end of this week

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

Following up to see if there is an update on this. Thanks!

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

I was stuck because there are big differences in how we set up the world. Do you need to create the world or just the robot? I think it will be much easier if I just use the mujoco xml as a robot definition.

from raisimlib.

ashishkumar1993 avatar ashishkumar1993 commented on August 18, 2024

I just need to load the cassie xml robot file.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

is that XML file public?

from raisimlib.

ashishkumar1993 avatar ashishkumar1993 commented on August 18, 2024

https://github.com/osudrl/cassie-mujoco-sim/blob/master/model/cassie.xml

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

great, this will help

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

just an update on this
Screenshot from 2021-05-09 12-14-31
My first implementation is done. I still have to test it with more models and debug it.

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

Thank you!

Although there is a urdf for cassie as well, it does not support passive joints like XML in mujoco does. Joints q5 and q6 of each leg in cassie is passive and not actuated. This is the primary reason which is forcing me to switch to XML.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

What is a passive joint? Is that a kinematic loop or unactuated joint?

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

Eq. 3 of this paper describes it. pasting it here for convenience:

"The joints (q1, q2, q3, q4, q7) are actuated. The joints (q5, q6) are passive, being formed by the introduction of (rather stiff) springs. When the springs are uncompressed, q5 = 0, and q6 = −q4 + 13°"

In the XML file, these are the <left/right>-knee-spring and the <left/right>-heel-spring in mujoco XML file. Below is an image showing all the joints of cassie and the springs.

Screen Shot 2021-05-09 at 2 05 04 PM

from raisimlib.

YandongJi avatar YandongJi commented on August 18, 2024

just an update on this
Screenshot from 2021-05-09 12-14-31
My first implementation is done. I still have to test it with more models and debug it.

Has this implementation pushed to the repo? I'm trying this. :)

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

not yet. It can load simple ones now but I need more work

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

I pushed the feature. It is very first time offering this feature so I probably have to iterate it multiple times. let me know how it works for you

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

Thanks! Im trying it out right now and will let you know. One issue I noticed --

The latest push contains absolute paths here, here and here. This is causing cmake to fail. It works once these I fixed these on my end.

I'm also unable to use raisimUnityOpenGL (raisimUnity works fine though, but it is a bit slow on my machine).

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

The mjcf examples load the xml file as an argument while constructing the raisim::World. I'm presently using raisimGymTorch, in which the Environment.hpp loads an articulated object with
addArticulatedSystem(resourceDir_+"/anymal/urdf/anymal.urdf");. Is there an equivalent call to load an xml file inside the Environment.hpp? I was looking through the api couldn't find it.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

hard coded path + raisim unity opengl issues fixed. I moved the world instantiation to the environment class constructor. You can provide the XML file when you create the world.

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

Thanks! I tried the updated version and here is where Im stuck -- Cassie has 10 actuated joints whereas gcDim is 35. This is also the dimension that the setPdTarget expects, but I'm not how to move the 10 actuated joints only.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

that part is not in the mjcf file. The cassie repo has many c++ files and I guess you can figure out how they simulated cassie there

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

I was looking through the cassie xml file and I found that line 230-242 list the actuators, and line 244-267 list the sensors. Although, I'm not sure how easy/hard it is to incorporate this in raisim.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

RaiSim does not have a concept of actuators and sensors. You can always set the torques for all joints and sense the positions of all joints. For the cassie model, the spring is not connected in the xml. I am not sure how they handle this.

from raisimlib.

ashish-kmr avatar ashish-kmr commented on August 18, 2024

Mujoco handles this through constraints written in Lines 223- 228. Instead of an actual spring, they enforce these constraints which mimic a very stiff spring.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

Currently, constraints live in World, not in an articulated system. Let me think about how to implement this nicely...

from raisimlib.

YandongJi avatar YandongJi commented on August 18, 2024

Thank you again for your work! But it seems that cassie's model is still not working.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

I will push it with the next version. This is not just reading the MJCF file. I need to integrate equality constraints to ArticulatedSystem.

from raisimlib.

christsa avatar christsa commented on August 18, 2024

Hi

The mjcf-file reader seems to put all frames except for the root at the same location (see attached image). I've tested it across different files and it occurs with all of them.

mjcf_reader

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

@christsa I already fixed this issue and will be included in the next push.

from raisimlib.

jhwangbo avatar jhwangbo commented on August 18, 2024

I also added equality constraints for mjcf files. It is not well tested so let me know how it performs.

from raisimlib.

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.