mujoco建模注意事项

<mujoco model="box">
  <compiler angle="radian" meshdir="assets" autolimits="true"/>

  <option timestep="0.001" gravity="0 0 -0.98" viscosity="0.1"/>
  
  <default>
    <!-- <geom friction="1.0 0.005 0.0001" density="1000"/> -->
    <geom friction="0.9 0.9 0.9" density="1000"/>
    <joint armature="0.01"/>
  </default>

  <worldbody>
    <!-- Box body -->  
    <!-- <body name="box" pos="-0.12 0.46 0.21"> -->
    <body name="box" pos="0 0.9 0.4">
      <!-- Add a free joint to allow movement in all directions -->
      <joint name="box_joint" type="free" damping="0.01"/>

      <!-- Box geometry -->
      <geom name="box_geom" type="box" mass="0.5" size="0.5 0.1 0.4" rgba="0.6 0.6 0.6 1"/>
      
      <!-- Add inertia for better physical behavior -->
      <inertial pos="0 0 0" mass="0.5" diaginertia="0.001 0.001 0.001"/>
    </body>
  </worldbody>

  <!-- Optionally, add a contact property for specific contact behavior -->
  <contact>
    <pair geom1="box_geom" geom2="floor" friction="0.2"/>
  </contact>
</mujoco>

其中长方体的z方向位置要和长方体高度一致,这样才能保证在地面上!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值