ROS入门(四)——Gazebo的基本使用
  iwehdio的博客园:https://www.cnblogs.com/iwehdio/

参考教程:
gazebo入门教程(一) 安装,UI介绍:https://blog.csdn.net/weixin_41045354/article/details/84881498
gazebo入门教程(二)建立简单模型:https://blog.csdn.net/weixin_41045354/article/details/103668162

1、界面概述

  • 卸载 ros-melodic 版本安装的 Gazebo9,安装 Gazebo11。

    $ sudo apt-get remove gazebo9 gazebo9-common gazebo9-plugin-base libgazebo9:amd64 libgazebo9-dev:amd64 ros-melodic-gazebo-*                   
    
    $ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
    $ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
    $ sudo apt-get update
    $ sudo apt-get install gazebo11
    $ sudo apt-get install libgazebo11-dev
  • 启动:

    • 命令行:roslaunch gazebo_ros empty_world.launch
    • 全局命令:Alt + F2,键入 gazebo 后回车。
  • 软件视图:

    • 场景:展示仿真模型。
    • 左面板:
      • WORLD:“世界”选项卡,显示当前在场景中的模型,并允许你查看和修改模型参数,例如它们的姿势。你还可以通过展开“GUI”选项并调整相机姿势来更改摄像机视角。
      • INSERT:“插入”选项卡,向模拟添加新对象(模型)。要查看模型列表,您可能需要单击箭头以展开文件夹。在要插入的模型上单击(和释放),然后在场景中再次单击以添加它。
      • LAYER:“图层”选项卡可组织和显示模拟中可用的不同可视化组(如果有)。图层可以包含一个或多个模型。打开或关闭图层将显示或隐藏该图层中的模型。这是一个可选功能,因此在大多数情况下此选项卡将为空。
    • 右面板:默认情况下Gazeb界面隐藏右侧面板。单击并拖动栏以将其打开。右侧面板可用于与所选模型(joint)的移动部件进行交互。如果未在场景中选择任何模型,则面板不会显示任何信息。
    • 上部工具栏:是Gazebo的主工具栏,它包含一些最常用的与模拟器交互的选项,例如:选择,移动,旋转和缩放对象等按钮; 创造一些简单的形状(如立方体,球体,圆柱体); 复制/粘贴模型选项。
      • 选择模式(select mode):在场景中导航。
      • 平移模式(translate mode):选择要移动的模型。
      • 旋转模式(rotate mode):选择要旋转的模型。
      • 缩放模式(scale mode):选择要缩放的模型。
      • 撤消/重做(undo/redo):撤消/重做场景中的操作。
      • 简单形状(simple shape):将简单形状插入场景中。
      • 灯光(lights):为场景添加灯光。
      • 复制/粘贴(copy/paste):在场景中复制/粘贴模型。
      • Align:将模型彼此对齐。
      • Snap:将一个模型与另一个模型对齐。
      • 更改视图(change view):从各个角度查看场景。
    • 底部工具栏:显示有关模拟的数据,如模拟时间及其与实际时间的关系。
      • “模拟时间”是指模拟运行时模拟器中时间流逝的速度。模拟时间可以比实时更慢或更快,具体取决于运行模拟所需的计算量。
      • “实时”是指模拟器运行时在现实生活中经过的实际时间。模拟时间和实时之间的关系称为“实时因子”(RTF)。它是模拟时间与实时的比率。RTF衡量模拟运行与实时相比的速度或速率。
      • Gazebo的世界状况每迭代一次,计算一次。你可以在底部工具栏的右侧看到迭代次数。每次迭代都会将模拟推进固定的秒数,称为步长。默认情况下,步长为1 ms。您可以按暂停按钮暂停模拟,并使用步骤按钮逐步执行几个步骤。
    • 菜单栏:更具体的功能。
    • 鼠标操作:
      • shift + 左键:旋转视角。
      • 左键:平移时间。
      • 滚轮:缩放大小。

2、创建一个简单的机器人

  • 进入模型编辑器,在顶部菜单栏中单击Edit,然后选择Model Editor。或者,使用热键Ctrl + M。

    • 左侧面板和顶部工具栏仅包含用于编辑和创建模型零件的小部件。
    • 上方的工具栏包含用于编辑模型的工具。包括用于与场景中的对象进行交互的工具。可用的工具包括选择,平移,缩放,旋转,撤消和重做,复制和粘贴,对齐,捕捉,视图调整以及联合创建。
    • 左面板有两个用于编辑模型的标签。
      • Insert 插入标签:用于添加关节和模型约束的工具。
        • 您可以将新零件(链接和模型)添加到模型编辑器。共分为三个部分。
        • 简单形状:这些是可以插入以在模型中形成链接的基本几何形状。
        • 自定义形状:该Add按钮允许您从模型的链接中导入自定义网格。目前,它支持COLLADA(.dae),3D Systems(.stl),Wavefront(.obj)和W3C SVG(.svg)文件。
        • 模型数据库:具有模型列表。可以按照与简单形状相同的方式将它们插入到“模型编辑器”中。插入后,它们称为嵌套模型
      • Model “模型”选项卡:允许编辑模型属性和内容。
        • 可以设置要构建的模型的名称和基本参数。它显示了模型中的链接,关节,模型约束和插件的列表。可以使用Link Inspector修改参数。
        • 可以使用下边的这些方法打开它。双击列表中的项目 /
          双击场景中的项目 / 右键单击列表中的项目,然后选择 Open Link Inspector / 右键单击场景中的项目,然后选择 Open Link Inspector。
  • 创建车辆:

    1. 底盘。

      • 在左侧面板的“insert”选项卡中,在“box”图标上单击一次,将光标移至“场景”中的任何位置,然后再次单击以释放框。

      • 接下来,调整盒子的尺寸。我们可以通过选择顶部工具栏上的“缩放”(第四个)工具来做到这一点。在“场景”中选择该框,并且该框上方应显示RGB标记。红色标记代表X轴,绿色代表Y,蓝色代表Z。

      • 将底盘降低到更靠近地面的位置。双击底盘模型以调出检查器链接检查器(link inspector)。向下滚动到 link 选项卡的底部以找到 Pose 参数,并将其更改Z为0.4m,然后在框外单击。单击OK以保存更改并关闭检查器。

      • link 选项卡有两个Pose,一定要注意设置的是下方的Pose。

    2. 前轮。

      • 从左侧面板上的 insert 选项卡插入圆柱体。

      • 使用Link Inspector沿X轴旋转它。双击圆柱体,滚动到底部的 Pose 部分,然后更改Roll为1.5707弧度(90度),然后在框外单击。暂时不要关闭检查器。

      • 接下来,通过提供确切的尺寸来调整轮子的尺寸。转到 visual 视觉选项卡以查看此链接中的视觉列表。向下滚动到Geometry部分,然后将其更改 Radius 为0.3m和 Length 为0.25m。

      • 现在,在较大的圆柱体内可以看到较小的圆柱。因为我们仅更改了视觉几何体,而没有更改碰撞。visual 是链接的图形表示,不影响物理模拟。切换到 collision 选项。设置Radius:0.3m和Length:0.25m 单击OK以保存更改并关闭检查器。

      • 通过复制粘贴创建另一个前轮。选中刚刚创建的前轮,在上方工具栏中点击复制(右起第六个),再点击粘贴(右起第五个),在场景中单击插入副本。

      • 现在,通过沿X轴正方向(场景中的红色标记)对齐底盘,确保车辆能够正确行驶。在下一步中添加车轮时,请确保它们位于沿X轴正方向延伸的车辆末端。

      • 底盘和车轮目前是自由移动的车身。为了限制它们的运动,我们将在每个车轮和底盘之间添加关节。单击顶部工具栏上的 Joint 图标(右起第一个)以弹出 Create Joint 对话框。

      • Create Joint 对话框包含通常为关节指定的关节属性。在配置任何属性之前,系统会提示您选择关节的父级和子级链接。将鼠标移到“场景”中的底盘上以使其突出显示,然后单击以将其设置为关节的父级。

        • 将鼠标移至左前轮;一条线现在应该从机箱的原点延伸到鼠标的末端。单击轮子将其设置为关节的子代。创建一个新的关节。默认情况下,它是旋转关节(Revolute),恰好是我们想要的 Joint Types 。
      • 接下来,我们需要配置轮子的旋转轴。在 Create Joint 对话框中,找到 Joint axis 并将其更改为Z(0,0,1)。注意轮子各个轴上的颜色显示。您应该看到一个黄色的环现在出现在关节图的蓝色箭头上方,表示其为旋转轴 。

      • 为了使车轮与底盘对齐,我们将在“ Joint Creation”对话框的部分中使用不同的对齐选项Align links。首先,我们将在X轴上对齐,因此单击 X Align Max 选项以查看对齐结果。圆柱体应突出显示以指示其姿势已更改。

      • 在我们的示例中,我们要使轮子与底盘平齐。要使车轮更靠近,请单击Y Align Max选项。但是,这还不是我们想要的。单击Y对齐选项旁边的Reverse选项,以将轮子的最小值(最大值的反方向)与底盘的最大值对齐。最后点击按Create。

        • 注意,此 Reverse 选项适用于子链接,因为下面的下拉列表中显示的默认对齐方式配置为 Child to Parent。如果设置了 Parent to Child 配置,则 Reverse 选项将应用于父链接
      • 要将轮子放置在地面上方,请双击轮子以打开链接检查器(link inspector)。我们可以使用Pose对话框底部的部分来移动轮子。假设轮子的半径为0.3m,请继续并将Z位置更改为0.3m以放置在地面上,然后按OK。

      • 将另一个前轮做同样的操作,注意使用 Y Align Min 选项将右轮对准底盘的另一侧。

    3. 脚轮。

      • 单击左侧面板上的“球形”按钮,然后将其插入场景。
      • 通过提供与前轮相同的确切尺寸来调整球体的大小。visual 选项卡Geometry部分并将其更改Radius为0.2m。确保对“collision”选项卡中的碰撞尺寸也执行相同的操作。
      • 要在脚轮和底盘之间创建关节,请单击顶部工具栏上的Joint图标,以显示Joint Creation对话框。将鼠标移至场景,然后选择底盘作为父链接,并选择球作为子链接。
      • 脚轮在所有方向滚动,并且没有特定的旋转轴。在凉亭中,这是使用球形接头模拟的。因此,在Joint types选项中,选择Ball(球连接)。
      • 接下来,对准脚轮,使其与底盘居中,并位于后端。在Align links部分中,选择Y Align Center,选择在Y轴上居中的选项,然后选择X Align Min(最小对齐),使脚轮移动到车轮右后方的选项。按下Create按钮以完成关节创建过程。
      • 打开link inspector并将Z位置设置为0.2m。
    4. 添加传感器。

      • 选择Insert选项卡以查看此部分中可用的模型列表(Model Database)。在列表中找到“深度相机” (Depth Camera),然后单击它以开始下载模型。

      • 看起来像一个小立方体。将鼠标移到场景上,然后单击汽车前面的空白处以插入深度摄像头。移动深度摄像头,使其位于车辆前部底盘的顶部,并大致位于Y轴的中心。

      • 将深度相机固定到机箱上。单击顶部工具栏中的“关节”(joint)图标以打开“关节创建” (Joint Creation )对话框。将鼠标移至场景,然后选择机箱作为父链接,选择深度摄像头作为子链接。选择Fixed选项(即固定连接)。

    5. 添加插件。

      • 在Model Plugins选项下面,单击Add按钮,弹出一个“模型插件检查器”。

      • 插件名为 smallcar_follower,使用的插件为libFollowerPlugin.so。

    6. 保存模型,退出模型编辑器。

      • 要测试插件是否正常工作,请在汽车前面插入一个盒子,然后观察汽车向其缓慢移动。

3、模型文件

  • model.config:

    <?xml version="1.0" ?>
    <model>
        <name>demo1</name>
        <version>1.0</version>
        <sdf version="1.7">model.sdf</sdf>
        <author>
            <name></name>
            <email></email>
        </author>
        <description></description>
    </model>
  • model.sdf:

    <?xml version='1.0'?>
    <sdf version='1.7'>
      <model name='demo1'>
        <link name='link_0'>
          <inertial>
            <mass>0.46147</mass>
            <inertia>
              <ixx>0.0245058</ixx>
              <ixy>0</ixy>
              <ixz>0</ixz>
              <iyy>0.155549</iyy>
              <iyz>0</iyz>
              <izz>0.172317</izz>
            </inertia>
            <pose>0 0 0 0 -0 0</pose>
          </inertial>
          <pose>-0.313793 -0.004174 0.046741 0 -0 0</pose>
          <gravity>1</gravity>
          <self_collide>0</self_collide>
          <kinematic>0</kinematic>
          <enable_wind>0</enable_wind>
          <visual name='visual'>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <box>
                <size>1.98602 0.732553 0.317192</size>
              </box>
            </geometry>
            <material>
              <lighting>1</lighting>
              <script>
                <uri>file://media/materials/scripts/gazebo.material</uri>
                <name>Gazebo/Grey</name>
              </script>
              <shader type='pixel'>
                <normal_map>__default__</normal_map>
              </shader>
              <ambient>0.3 0.3 0.3 1</ambient>
              <diffuse>0.7 0.7 0.7 1</diffuse>
              <specular>0.01 0.01 0.01 1</specular>
              <emissive>0 0 0 1</emissive>
            </material>
            <transparency>0</transparency>
            <cast_shadows>1</cast_shadows>
          </visual>
          <collision name='collision'>
            <laser_retro>0</laser_retro>
            <max_contacts>10</max_contacts>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <box>
                <size>1.98602 0.732553 0.317192</size>
              </box>
            </geometry>
            <surface>
              <friction>
                <ode>
                  <mu>1</mu>
                  <mu2>1</mu2>
                  <fdir1>0 0 0</fdir1>
                  <slip1>0</slip1>
                  <slip2>0</slip2>
                </ode>
                <torsional>
                  <coefficient>1</coefficient>
                  <patch_radius>0</patch_radius>
                  <surface_radius>0</surface_radius>
                  <use_patch_radius>1</use_patch_radius>
                  <ode>
                    <slip>0</slip>
                  </ode>
                </torsional>
              </friction>
              <bounce>
                <restitution_coefficient>0</restitution_coefficient>
                <threshold>1e+06</threshold>
              </bounce>
              <contact>
                <collide_without_contact>0</collide_without_contact>
                <collide_without_contact_bitmask>1</collide_without_contact_bitmask>
                <collide_bitmask>1</collide_bitmask>
                <ode>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                  <max_vel>0.01</max_vel>
                  <min_depth>0</min_depth>
                </ode>
                <bullet>
                  <split_impulse>1</split_impulse>
                  <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                </bullet>
              </contact>
            </surface>
          </collision>
        </link>
        <link name='link_1'>
          <inertial>
            <mass>1</mass>
            <inertia>
              <ixx>0.145833</ixx>
              <ixy>0</ixy>
              <ixz>0</ixz>
              <iyy>0.145833</iyy>
              <iyz>0</iyz>
              <izz>0.125</izz>
            </inertia>
            <pose>0 0 0 0 -0 0</pose>
          </inertial>
          <pose>0.379214 0.502131 -0.053259 1.5707 -0 0</pose>
          <gravity>1</gravity>
          <self_collide>0</self_collide>
          <kinematic>0</kinematic>
          <enable_wind>0</enable_wind>
          <visual name='visual'>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <cylinder>
                <radius>0.3</radius>
                <length>0.25</length>
              </cylinder>
            </geometry>
            <material>
              <lighting>1</lighting>
              <script>
                <uri>file://media/materials/scripts/gazebo.material</uri>
                <name>Gazebo/Grey</name>
              </script>
              <shader type='pixel'>
                <normal_map>__default__</normal_map>
              </shader>
              <ambient>0.3 0.3 0.3 1</ambient>
              <diffuse>0.7 0.7 0.7 1</diffuse>
              <specular>0.01 0.01 0.01 1</specular>
              <emissive>0 0 0 1</emissive>
            </material>
            <transparency>0</transparency>
            <cast_shadows>1</cast_shadows>
          </visual>
          <collision name='collision'>
            <laser_retro>0</laser_retro>
            <max_contacts>10</max_contacts>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <cylinder>
                <radius>0.3</radius>
                <length>0.25</length>
              </cylinder>
            </geometry>
            <surface>
              <friction>
                <ode>
                  <mu>1</mu>
                  <mu2>1</mu2>
                  <fdir1>0 0 0</fdir1>
                  <slip1>0</slip1>
                  <slip2>0</slip2>
                </ode>
                <torsional>
                  <coefficient>1</coefficient>
                  <patch_radius>0</patch_radius>
                  <surface_radius>0</surface_radius>
                  <use_patch_radius>1</use_patch_radius>
                  <ode>
                    <slip>0</slip>
                  </ode>
                </torsional>
              </friction>
              <bounce>
                <restitution_coefficient>0</restitution_coefficient>
                <threshold>1e+06</threshold>
              </bounce>
              <contact>
                <collide_without_contact>0</collide_without_contact>
                <collide_without_contact_bitmask>1</collide_without_contact_bitmask>
                <collide_bitmask>1</collide_bitmask>
                <ode>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                  <max_vel>0.01</max_vel>
                  <min_depth>0</min_depth>
                </ode>
                <bullet>
                  <split_impulse>1</split_impulse>
                  <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                </bullet>
              </contact>
            </surface>
          </collision>
        </link>
        <link name='link_1_clone'>
          <inertial>
            <mass>1</mass>
            <inertia>
              <ixx>0.145833</ixx>
              <ixy>0</ixy>
              <ixz>0</ixz>
              <iyy>0.145833</iyy>
              <iyz>0</iyz>
              <izz>0.125</izz>
            </inertia>
            <pose>0 0 0 0 -0 0</pose>
          </inertial>
          <pose>0.379215 -0.495479 -0.053259 1.5707 -0 0</pose>
          <gravity>1</gravity>
          <self_collide>0</self_collide>
          <kinematic>0</kinematic>
          <enable_wind>0</enable_wind>
          <visual name='visual'>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <cylinder>
                <radius>0.3</radius>
                <length>0.25</length>
              </cylinder>
            </geometry>
            <material>
              <lighting>1</lighting>
              <script>
                <uri>file://media/materials/scripts/gazebo.material</uri>
                <name>Gazebo/Grey</name>
              </script>
              <shader type='pixel'>
                <normal_map>__default__</normal_map>
              </shader>
              <ambient>0.3 0.3 0.3 1</ambient>
              <diffuse>0.7 0.7 0.7 1</diffuse>
              <specular>0.01 0.01 0.01 1</specular>
              <emissive>0 0 0 1</emissive>
            </material>
            <transparency>0</transparency>
            <cast_shadows>1</cast_shadows>
          </visual>
          <collision name='collision'>
            <laser_retro>0</laser_retro>
            <max_contacts>10</max_contacts>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <cylinder>
                <radius>0.3</radius>
                <length>0.25</length>
              </cylinder>
            </geometry>
            <surface>
              <friction>
                <ode>
                  <mu>1</mu>
                  <mu2>1</mu2>
                  <fdir1>0 0 0</fdir1>
                  <slip1>0</slip1>
                  <slip2>0</slip2>
                </ode>
                <torsional>
                  <coefficient>1</coefficient>
                  <patch_radius>0</patch_radius>
                  <surface_radius>0</surface_radius>
                  <use_patch_radius>1</use_patch_radius>
                  <ode>
                    <slip>0</slip>
                  </ode>
                </torsional>
              </friction>
              <bounce>
                <restitution_coefficient>0</restitution_coefficient>
                <threshold>1e+06</threshold>
              </bounce>
              <contact>
                <collide_without_contact>0</collide_without_contact>
                <collide_without_contact_bitmask>1</collide_without_contact_bitmask>
                <collide_bitmask>1</collide_bitmask>
                <ode>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                  <max_vel>0.01</max_vel>
                  <min_depth>0</min_depth>
                </ode>
                <bullet>
                  <split_impulse>1</split_impulse>
                  <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                </bullet>
              </contact>
            </surface>
          </collision>
        </link>
        <link name='link_2'>
          <inertial>
            <mass>1</mass>
            <inertia>
              <ixx>0.1</ixx>
              <ixy>0</ixy>
              <ixz>0</ixz>
              <iyy>0.1</iyy>
              <iyz>0</iyz>
              <izz>0.1</izz>
            </inertia>
            <pose>0 0 0 0 -0 0</pose>
          </inertial>
          <pose>-1.1068 -0.004174 -0.153259 0 -0 0</pose>
          <gravity>1</gravity>
          <self_collide>0</self_collide>
          <kinematic>0</kinematic>
          <enable_wind>0</enable_wind>
          <visual name='visual'>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <sphere>
                <radius>0.2</radius>
              </sphere>
            </geometry>
            <material>
              <lighting>1</lighting>
              <script>
                <uri>file://media/materials/scripts/gazebo.material</uri>
                <name>Gazebo/Grey</name>
              </script>
              <shader type='pixel'>
                <normal_map>__default__</normal_map>
              </shader>
              <ambient>0.3 0.3 0.3 1</ambient>
              <diffuse>0.7 0.7 0.7 1</diffuse>
              <specular>0.01 0.01 0.01 1</specular>
              <emissive>0 0 0 1</emissive>
            </material>
            <transparency>0</transparency>
            <cast_shadows>1</cast_shadows>
          </visual>
          <collision name='collision'>
            <laser_retro>0</laser_retro>
            <max_contacts>10</max_contacts>
            <pose>0 0 0 0 -0 0</pose>
            <geometry>
              <sphere>
                <radius>0.2</radius>
              </sphere>
            </geometry>
            <surface>
              <friction>
                <ode>
                  <mu>1</mu>
                  <mu2>1</mu2>
                  <fdir1>0 0 0</fdir1>
                  <slip1>0</slip1>
                  <slip2>0</slip2>
                </ode>
                <torsional>
                  <coefficient>1</coefficient>
                  <patch_radius>0</patch_radius>
                  <surface_radius>0</surface_radius>
                  <use_patch_radius>1</use_patch_radius>
                  <ode>
                    <slip>0</slip>
                  </ode>
                </torsional>
              </friction>
              <bounce>
                <restitution_coefficient>0</restitution_coefficient>
                <threshold>1e+06</threshold>
              </bounce>
              <contact>
                <collide_without_contact>0</collide_without_contact>
                <collide_without_contact_bitmask>1</collide_without_contact_bitmask>
                <collide_bitmask>1</collide_bitmask>
                <ode>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                  <max_vel>0.01</max_vel>
                  <min_depth>0</min_depth>
                </ode>
                <bullet>
                  <split_impulse>1</split_impulse>
                  <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
                  <soft_cfm>0</soft_cfm>
                  <soft_erp>0.2</soft_erp>
                  <kp>1e+13</kp>
                  <kd>1</kd>
                </bullet>
              </contact>
            </surface>
          </collision>
        </link>
        <model name='depth_camera'>
          <link name='link'>
            <pose>0 0 0.05 0 -0 0</pose>
            <inertial>
              <mass>0.1</mass>
              <inertia>
                <ixx>0.000166667</ixx>
                <iyy>0.000166667</iyy>
                <izz>0.000166667</izz>
                <ixy>0</ixy>
                <ixz>0</ixz>
                <iyz>0</iyz>
              </inertia>
              <pose>0 0 0 0 -0 0</pose>
            </inertial>
            <collision name='collision'>
              <geometry>
                <box>
                  <size>0.1 0.1 0.1</size>
                </box>
              </geometry>
              <surface>
                <contact>
                  <ode/>
                </contact>
                <bounce/>
                <friction>
                  <torsional>
                    <ode/>
                  </torsional>
                  <ode/>
                </friction>
              </surface>
              <max_contacts>10</max_contacts>
            </collision>
            <visual name='visual'>
              <geometry>
                <box>
                  <size>0.1 0.1 0.1</size>
                </box>
              </geometry>
            </visual>
            <sensor name='camera' type='depth'>
              <camera>
                <horizontal_fov>1.047</horizontal_fov>
                <image>
                  <width>320</width>
                  <height>240</height>
                </image>
                <clip>
                  <near>0.1</near>
                  <far>100</far>
                </clip>
              </camera>
              <always_on>1</always_on>
              <update_rate>30</update_rate>
              <visualize>1</visualize>
            </sensor>
            <self_collide>0</self_collide>
            <enable_wind>0</enable_wind>
            <kinematic>0</kinematic>
          </link>
          <pose>0.662164 0.001695 0.213037 0 -0 0</pose>
        </model>
        <joint name='link_0_JOINT_0' type='revolute'>
          <parent>link_0</parent>
          <child>link_1</child>
          <pose>0 0 0 0 -0 0</pose>
          <axis>
            <xyz>0 0 1</xyz>
            <limit>
              <lower>-1.79769e+308</lower>
              <upper>1.79769e+308</upper>
              <effort>-1</effort>
              <velocity>-1</velocity>
            </limit>
            <dynamics>
              <spring_reference>0</spring_reference>
              <spring_stiffness>0</spring_stiffness>
              <damping>0</damping>
              <friction>0</friction>
            </dynamics>
          </axis>
          <physics>
            <ode>
              <limit>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </limit>
              <suspension>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </suspension>
            </ode>
          </physics>
        </joint>
        <joint name='link_0_JOINT_1' type='revolute'>
          <parent>link_0</parent>
          <child>link_1_clone</child>
          <pose>0 0 0 0 -0 0</pose>
          <axis>
            <xyz>0 0 1</xyz>
            <limit>
              <lower>-1.79769e+308</lower>
              <upper>1.79769e+308</upper>
              <effort>-1</effort>
              <velocity>-1</velocity>
            </limit>
            <dynamics>
              <spring_reference>0</spring_reference>
              <spring_stiffness>0</spring_stiffness>
              <damping>0</damping>
              <friction>0</friction>
            </dynamics>
          </axis>
          <physics>
            <ode>
              <limit>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </limit>
              <suspension>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </suspension>
            </ode>
          </physics>
        </joint>
        <joint name='link_0_JOINT_2' type='ball'>
          <parent>link_0</parent>
          <child>link_2</child>
          <pose>0 0 0 0 -0 0</pose>
          <physics>
            <ode>
              <limit>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </limit>
              <suspension>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </suspension>
            </ode>
          </physics>
        </joint>
        <joint name='link_JOINT_3' type='fixed'>
          <parent>depth_camera::link</parent>
          <child>link_0</child>
          <pose>0 0 0 0 -0 0</pose>
          <physics>
            <ode>
              <limit>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </limit>
              <suspension>
                <cfm>0</cfm>
                <erp>0.2</erp>
              </suspension>
            </ode>
          </physics>
        </joint>
        <static>0</static>
        <allow_auto_disable>1</allow_auto_disable>
        <plugin name='smallcar_follower' filename='libFollowerPlugin.so'/>
      </model>
    </sdf>

——————来源于结束于否定之否定。——————