Gazebo 中为地面和车轮添加摩擦属性
移动机器人在仿真时,一旦以较大的速度启动,就会翘头导致翻车
考虑是没有地面摩擦力,因此尝试地面和车轮添加摩擦属性
地面的摩擦系数在 SDF 文件中配置,参考 cafe.world 编辑 empty.world
<sdf version='1.6'>
<world name='default'>
<model name='ground_plane'>
<static>1</static>
<link name='link'>
<collision name='collision'>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<surface>
<friction>
<ode>
<mu>1</mu>
<mu2>0.9</mu2>
</ode>
<torsional>
<ode/>
</torsional>
</friction>
<contact>
<ode/>
</contact>
<bounce/>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name='visual'>
<cast_shadows>0</cast_shadows>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
</link>
</model>
<light name='sun' type='directional'>
<cast_shadows>1</cast_shadows>
<pose frame=''>0 0 10 0 -0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<gravity>0 0 -9.8</gravity>
<magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
<atmosphere type='adiabatic'/>
<physics name='default_physics' default='0' type='ode'>
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
<scene>
<ambient>0.4 0.4 0.4 1</ambient>
<background>0.7 0.7 0.7 1</background>
<shadows>1</shadows>
</scene>
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>0</latitude_deg>
<longitude_deg>0</longitude_deg>
<elevation>0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
</world>
</sdf>
<surface>
: 定义碰撞元素的物理属性<friction>
: 描述碰撞表面的摩擦属性<ode>
: 使用ODE作为物理引擎<mu>1.0</mu>
: 静摩擦系数<mu2>1.0</mu2>
: 动摩擦系数
<contact>
: 描述碰撞元素的接触属性
<max_contacts>10</max_contacts>
: 设置最大接触数
在URDF中配置链接(link
)的摩擦属性可以使用 <gazebo>
元素,其中包含 <mu1>
和 <mu2>
元素来指定静摩擦系数和动摩擦系数
<link name="my_link">
<!-- 其他链接属性 -->
<gazebo>
<mu1>0.5</mu1> <!-- 静摩擦系数 -->
<mu2>0.3</mu2> <!-- 动摩擦系数 -->
</gazebo>
<!-- 其他链接元素,如碰撞、视觉等 -->
</link>
为地面和车轮添加摩擦属性后效果几乎没有,将整车质量由 100kg 调整为 150kg
,并且将 base_link
和 steer_link
的重心下移后,在 0.5m/s 及以下速度启动不会有翘头现象