MuJoCo Lec8 Hybrid系统的建模与控制
如果要定义3D的floating base 模型的头6个dof:
<worldbody>
<geom name='floor' pos='0.001 0 0' size='100 10 .125' type='plane' material='plane' condim='3' conaffinity='15'/>
<light mode='trackcom' pos='0 0 5' dir='0 0 -1'/>
<light directional='true' pos='0 0 3' dir='0 0 -1' diffuse='0.2 0.2 0.2' specular='0 0 0'/>
<body name='pelvis' pos='0 0 1.01'>
<joint type='slide' axis='1 0 0' limited='false'/>
<joint type='slide' axis='0 1 0' limited='false'/>
<joint type='slide' axis='0 0 1' limited='false' ref='1.01'/>
<joint type='ball' limited='false'/>
<!--上面是头6个的dof的定义,需要在所有dof之前-->
</body>
</worldbody>
</mujoco>
在模拟程序中显示世界坐标,体坐标,COM的方法
opt.frame = mjFRAME_WORLD; //mjFRAME_BODY
opt.flags[mjVIS_COM] = 1 ; //mjVIS_JOINT;
opt.flags[mjVIS_JOINT] = 1 ;
f是科里奥利力,D+C+G=u的G为什么不需要了?
因为我们有约束x,z是不动的,所以还要加上一个约束力输入
contact="enable"的作用是物体掉下去的时候,会被地板接住
<mujoco>
<option timestep="0.001" integrator="RK4" gravity="0 0 -9.81">
<flag sensornoise="disable" contact="enable" energy="enable"/>
</option>
<worldbody>
<light diffuse=".5 .5 .5" pos="0 0 3" dir="0 0 -1"/>
<geom type="plane" size="5 5 0.1" rgba=".9 0 0 1"/>
<body name="pole" pos="0 0 2" euler="0 0 0">
<joint name="x" type="slide" pos="0 0 0.5" axis="1 0 0" />
<joint name="z" type="slide" pos="0 0 0.5" axis="0 0 1" />
<joint name="pin" type="hinge" pos="0 0 0.5" axis="0 -1 0" />
<geom type="cylinder" size=".05 .5" rgba="0 .9 0 0.1" mass="1"/>
</body>
<body name="pole2" pos="0 -1 2" euler="0 0 0">
<joint