文章目录
- 下载碰撞插件
- 在.world文件添加actor模型
- 项目演示
- 参考
下载碰撞插件
按照github的readme.md进行编译,找到libActorCollisionsPlugin.so所在位置(重要!),这是给行人添加碰撞属性的插件。
git clone https://github.com/osrf/gazebo/tree/gazebo11/examples/plugins/actor_collisions
在.world文件添加actor模型
<!--create moving objects -->
<actor name="actor0">
<link name='link'>
<inertial>
<mass>1</mass>
<inertia>
<ixx>0.166667</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.166667</iyy>
<iyz>0</iyz>
<izz>0.166667</izz>
</inertia>
</inertial>
<collision name='collision'>
<geometry>
<box>
<size>0.5 1.5 0.5</size>
</box>
</geometry>
</collision>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<gravity>1</gravity>
</link>
<plugin name="actor_collisions_plugin" filename="/your Path/libActorCollisionsPlugin.so">
<scaling collision="LHipJoint_LeftUpLeg_collision" scale="0.01 0.001 0.001"/>
<scaling collision="LeftUpLeg_LeftLeg_collision" scale="8.0 8.0 1.0"/>
<scaling collision="LeftLeg_LeftFoot_collision" scale="8.0 8.0 1.0"/>
<scaling collision="LeftFoot_LeftToeBase_collision" scale="4.0 4.0 1.5"/>
<scaling collision="RHipJoint_RightUpLeg_collision" scale="0.01 0.001 0.001"/>
<scaling collision="RightUpLeg_RightLeg_collision" scale="8.0 8.0 1.0"/>
<scaling collision="RightLeg_RightFoot_collision" scale="8.0 8.0 1.0"/>
<scaling collision="RightFoot_RightToeBase_collision" scale="4.0 4.0 1.5"/>
<scaling collision="LowerBack_Spine_collision" scale="12.0 20.0 5.0" pose="0.05 0 0 0 -0.2 0"/>
<scaling collision="Spine_Spine1_collision" scale="0.01 0.001 0.001"/>
<scaling collision="Neck_Neck1_collision" scale="0.01 0.001 0.001"/>
<scaling collision="Neck1_Head_collision" scale="5.0 5.0 3.0"/>
<scaling collision="LeftShoulder_LeftArm_collision" scale="0.01 0.001 0.001"/>
<scaling collision="LeftArm_LeftForeArm_collision" scale="5.0 5.0 1.0"/>
<scaling collision="LeftForeArm_LeftHand_collision" scale="5.0 5.0 1.0"/>
<scaling collision="LeftFingerBase_LeftHandIndex1_collision" scale="4.0 4.0 3.0"/>
<scaling collision="RightShoulder_RightArm_collision" scale="0.01 0.001 0.001"/>
<scaling collision="RightArm_RightForeArm_collision" scale="5.0 5.0 1.0"/>
<scaling collision="RightForeArm_RightHand_collision" scale="5.0 5.0 1.0"/>
<scaling collision="RightFingerBase_RightHandIndex1_collision" scale="4.0 4.0 3.0"/>
</plugin>
<skin>
<filename>walk.dae</filename>
<scale>1.0</scale>
</skin>
<animation name="walking">
<filename>walk.dae</filename>
<interpolate_x>true</interpolate_x>
</animation>
<static>true</static>
<pose>24 -0.0 0.1 0 0 2.84</pose>
<script> <loop>true</loop> <delay_start>0.0</delay_start> <auto_start>true</auto_start> <trajectory id="0" type="walking"> <waypoint> <time>0.0</time> <pose>24 -0.0 0.1 0 0 2.84</pose> </waypoint> <waypoint> <time>30.0</time> <pose>0 -0.0 0.1 0 0 2.84</pose> </waypoint> <waypoint> <time>40</time> <pose>0 -0.0 0.1 0 0 0.3</pose> </waypoint> <waypoint> <time>70</time> <pose>24 -0.0 0.1 0 0 0.3</pose> </waypoint> <waypoint> <time>80.0</time> <pose>24 -0.0 0.1 0 0 2.84</pose> </waypoint> </trajectory> </script>
</actor>
actor的一些动作模型
- moonwalk.dae
- run.dae
- sit_down.dae
- sitting.dae
- stand_up.dae
- stand.dae
- talk_a.dae
- talk_b.dae
- walk.dae
项目演示
[gazebo仿真]创建actor动画
参考
【1】官方文档http://gazebosim.org/tutorials?tut=actor#Scriptedtrajectories