Skip to content

Commit

Permalink
make hopper work
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter committed Sep 18, 2023
1 parent abb13b6 commit 627e201
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Copy test_shadow_hand.py to mujoco_menagerie/shadow_hand
run: |
cp test_shadow_hand.py mujoco_menagerie/shadow_hand
cp tests/menagerie_test_shadow_hand.py mujoco_menagerie/shadow_hand/test_shadow_hand.py
working-directory: ${{ runner.workspace }}

- name: Navigate to shadow_hand folder
Expand Down
2 changes: 1 addition & 1 deletion tests/ant.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mujoco model="ant">
<compiler angle="degree" coordinate="local" inertiafromgeom="true"/>
<compiler angle="degree"/>
<option integrator="RK4" timestep="0.01"/>
<custom>
<numeric data="0.0 0.0 0.55 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0 1.0" name="init_qpos"/>
Expand Down
69 changes: 38 additions & 31 deletions tests/hopper.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
<mujoco model="hopper">
<compiler angle="degree" inertiafromgeom="true"/>
<default>
<joint armature="1" damping="1" limited="true"/>
<geom conaffinity="1" condim="1" contype="1" margin="0.001" friction="0.8 .1 .1" rgba="0.8 0.6 .4 1" solimp=".8 .8 .01" solref=".02 1"/>
<motor ctrllimited="true" ctrlrange="-.4 .4"/>
</default>
<option integrator="RK4" timestep="0.002"/>
<worldbody>
<body name="torso">
<joint armature="0" axis="1 0 0" damping="0" limited="false" name="ignore1" pos="0 0 0" stiffness="0" type="slide"/>
<joint armature="0" axis="0 0 1" damping="0" limited="false" name="ignore2" pos="0 0 0" ref="1.25" stiffness="0" type="slide"/>
<joint armature="0" axis="0 1 0" damping="0" limited="false" name="ignore3" pos="0 0 0" stiffness="0" type="hinge"/>
<geom fromto="0 0 1.45 0 0 1.05" name="torso_geom" size="0.05" type="capsule"/>
<body name="thigh">
<joint axis="0 -1 0" name="thigh_joint" pos="0 0 1.05" range="-150 0" type="hinge"/>
<geom fromto="0 0 1.05 0 0 0.6" name="thigh_geom" size="0.05" type="capsule"/>
<body name="leg">
<joint axis="0 -1 0" name="leg_joint" pos="0 0 0.6" range="-150 0" type="hinge"/>
<geom fromto="0 0 0.6 0 0 0.1" name="leg_geom" size="0.04" type="capsule"/>
<body name="foot">
<joint axis="0 -1 0" name="foot_joint" pos="0 0 0.1" range="-45 45" type="hinge"/>
<geom fromto="-0.13 0 0.1 0.26 0 0.1" name="foot_geom" size="0.06" type="capsule"/>
</body>
<compiler angle="degree"/>
<default>
<joint armature="1" damping="1" limited="true"/>
<geom conaffinity="1" condim="1" contype="1" margin="0.001" friction="0.8 .1 .1" rgba="0.8 0.6 .4 1"
solimp=".8 .8 .01" solref=".02 1"/>
<motor ctrllimited="true" ctrlrange="-.4 .4"/>
</default>
<option integrator="RK4" timestep="0.002"/>
<worldbody>
<body name="torso">
<inertial mass="10" pos="0 0 0" diaginertia="0.1 0.1 0.1"/>
<joint armature="0" axis="1 0 0" damping="0" limited="false" name="ignore1" stiffness="0" type="slide"/>
<body>
<inertial mass="1" pos="0 0 0" diaginertia="0.01 0.01 0.01"/>
<joint armature="0" axis="0 0 1" damping="0" limited="false" name="ignore2" ref="1.25" stiffness="0" type="slide"/>
<body>
<joint armature="0" axis="0 1 0" damping="0" limited="false" name="ignore3" stiffness="0" type="hinge"/>
<geom fromto="0 0 1.45 0 0 1.05" name="torso_geom" size="0.05" type="capsule"/>
<body name="thigh">
<joint axis="0 -1 0" name="thigh_joint" pos="0 0 1.05" range="-150 0" type="hinge"/>
<geom fromto="0 0 1.05 0 0 0.6" name="thigh_geom" size="0.05" type="capsule"/>
<body name="leg">
<joint axis="0 -1 0" name="leg_joint" pos="0 0 0.6" range="-150 0" type="hinge"/>
<geom fromto="0 0 0.6 0 0 0.1" name="leg_geom" size="0.04" type="capsule"/>
<body name="foot">
<joint axis="0 -1 0" name="foot_joint" pos="0 0 0.1" range="-45 45" type="hinge"/>
<geom fromto="-0.13 0 0.1 0.26 0 0.1" name="foot_geom" size="0.06" type="capsule"/>
</body>
</body>
</body>
</body>
</body>
</body>
</body>
</body>
</worldbody>
<actuator>
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="thigh_joint"/>
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="leg_joint"/>
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="foot_joint"/>
</actuator>
</worldbody>
<actuator>
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="thigh_joint"/>
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="leg_joint"/>
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="foot_joint"/>
</actuator>
</mujoco>
2 changes: 1 addition & 1 deletion tests/humanoid.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mujoco model='humanoid'>
<compiler inertiafromgeom='true' angle='degree'/>
<compiler angle='degree'/>

<default>
<joint limited='true' damping='1' armature='0' />
Expand Down
File renamed without changes.

0 comments on commit 627e201

Please sign in to comment.