学习的内容:
(1)创建HDL-32传感器的SDF文件模型
(2)将创建的模型应用到gazebo的模型库
(3)实现模型的显示和输出
(4)使用插件控制模型
(5)在gazebo和RViz中可视化模型
《一》模型的创建
模型:
(1)a base cylinder and top cylinder, where the top cylinder spins, and
(2)a set of laser rays oriented in the vertical fan.
step 1:创建world文件
选择一个文件夹,打开终端输入:gedit velodyne.world
在文件中输入以下内容:
<?xml version="1.0" ?>
<sdf version="1.5">
<world name="default">
<!-- A global light source -->
<include>
<uri>model://sun</uri>
</include>
<!-- A ground plane -->
<include>
<uri>model://ground_plane</uri>
</include>
</world>
</sdf>
world文件的主要内容是设置地面和灯光。
step2:在world文件的标签前加入以下内容:
<model name="velodyne_hdl-32">
<!-- Give the base link a unique name -->
<link name="base">
<!-- Offset the base by half the lenght of the cylinder -->
<pose>0 0 0.029335 0 0 0</pose>
<collision name="base_collision">
<geometry>
<cylinder>
<!-- Radius and length provided by Velodyne -->
<radius>.04267</radius>
<length>.05867</length>
</cylinder>
</geometry>
</collision>
<!-- The visual is mostly a copy of the collision -->
<visual name="base_visual">
<geometry>
<cylinder>
<radius>.04267</radius>
<length>.05867</length>
</cylinder>
</geometry>
</visual>
</link>
<!-- Give the base link a unique name -->
<link name="top">
<!-- Vertically offset the top cylinder by the length of the bottom
cylinder and half the length of this cylinder. -->
<pose>0 0 0.095455 0 0 0</pose>
<collision name="top_collision">
<geometry>
<cylinde