Skip to content

Instantly share code, notes, and snippets.

@rhaps0dy
Created December 23, 2017 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhaps0dy/6e0906e747ffb913c678e1bbab3a0823 to your computer and use it in GitHub Desktop.
Save rhaps0dy/6e0906e747ffb913c678e1bbab3a0823 to your computer and use it in GitHub Desktop.
Bullet CartPole simulation files
<mujoco model="inverted pendulum">
<compiler inertiafromgeom="true"/>
<default>
<joint pos="0 0 0" armature="0" damping="0" frictionloss="0" limited="true"/>
<geom pos="0 0 0" contype="0" conaffinity="0" friction="0 0 0"
rgba="0.7 0.7 0 1"/>
<tendon/>
<motor ctrlrange="-1 1" ctrllimited="true"/>
</default>
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.02"/>
<size nstack="3000"/>
<worldbody>
<geom name="rail" pos="0 0 0" quat="0.707 0 0.707 0" rgba="0.3 0.3 0.7 1"
size="0.02 2" type="capsule"/>
<body pos="0 0 0" name="cart">
<joint name="slider" axis="1 0 0" range="-2 2" frictionloss="0.0105"
type="slide"/>
<geom name="cart" pos="0 0 0" quat="0.707 0 0.707 0" size="0.1 0.1"
type="capsule"/>
<inertial pos="0 0 0" mass="0.5" diaginertia="1 1 1"/>
<body pos="0 0 0" name="pole">
<joint axis="0 1 0" name="hinge" limited="false" type="hinge"/>
<!-- Bullet re-centers the capsule, so we need to specify it centered in
order to have Bullet and MuJoCo do the same thing -->
<geom fromto="0 0 -0.25 0 0 0.25" pos="0 0 0.25" name="cpole" rgba="0 0.7 0.7 1"
size="0.05 0.5" type="capsule"/>
<inertial pos="0 0 0.25" mass="0.5" diaginertia="0.01042 0.01042 6.3e-6"/>
</body>
</body>
</worldbody>
<actuator>
<motor gear="100" joint="slider" name="m_slider"/>
</actuator>
</mujoco>
<!-- Initial state: [slider, slider_vel, hinge, hinge_vel] = [0.2076, 0.0233, -3.2284, -0.1377] -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment