Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting URDF file in Mojoco #1767

Open
Akanksha0401 opened this issue Jun 29, 2024 · 1 comment
Open

Error converting URDF file in Mojoco #1767

Akanksha0401 opened this issue Jun 29, 2024 · 1 comment
Labels
question Request for help or information

Comments

@Akanksha0401
Copy link

Akanksha0401 commented Jun 29, 2024

Dear Colleagues,

I was having trouble in converting the URDF file of Single Leg Hopper in mujoco , I tried adding

<mujoco> 
    <compiler meshdir="C:\Users\Akanksha Mishra\Downloads\mujoco-3.1.6-windows-x86_64\model\meshes" balanceinertia="true"  discardvisual="false" />
   <worldbody>
   <light pos=".4 -.4 .3" dir="-2 2 -1.5" diffuse=".6 .6 .6"/>
   <light pos="-.2 -.4 .3" dir="1 2 -1.5" diffuse=".6 .6 .6"/>
   <geom type="plane" size=".5 .5 .01"/>
   <body name="ball" pos="0 0 0.05">
     <freejoint/>
     <geom size=".03"/>
   </body>
   <body name="hammer" pos="-.05 0 0.18">
     <joint axis="0 1 0"/>
     <geom type="capsule" size=".01" fromto="0 0 0 -.15 0 0"/>
     <geom type="box" size=".02 .02 .03" pos="-.15 0 0"/>
   </body>
 </worldbody>
   </mujoco>

but when it gets open in Mujoco, the object (robotic leg as given below) falls immediately.

My XML file looks somewhat like this-

<?xml version="1.0" ?>
<robot name="hopper">
<mujoco> 
    <compiler meshdir="C:\Users\Akanksha Mishra\Downloads\mujoco-3.1.6-windows-x86_64\model\meshes" balanceinertia="true"  discardvisual="false" />
   <worldbody>
   <light pos=".4 -.4 .3" dir="-2 2 -1.5" diffuse=".6 .6 .6"/>
   <light pos="-.2 -.4 .3" dir="1 2 -1.5" diffuse=".6 .6 .6"/>
   <geom type="plane" size=".5 .5 .01"/>
   <body name="ball" pos="0 0 0.05">
     <freejoint/>
     <geom size=".03"/>
   </body>
   <body name="hammer" pos="-.05 0 0.18">
     <joint axis="0 1 0"/>
     <geom type="capsule" size=".01" fromto="0 0 0 -.15 0 0"/>
     <geom type="box" size=".02 .02 .03" pos="-.15 0 0"/>
   </body>
 </worldbody>
   </mujoco>
 <link name="world"/>
 <joint name="fixed" type="fixed">

Please guide , what could be a possible solution.
image
image

@Akanksha0401 Akanksha0401 added the question Request for help or information label Jun 29, 2024
@yuvaltassa
Copy link
Collaborator

There is not enough information in this issue for us to help you.
From a cursory look it seems like "hammer" is supposed to be a child of "ball"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or information
Projects
None yet
Development

No branches or pull requests

2 participants