1. 在gazebo world中用以下方式加载模型时:

<include>
      <uri>model://one_building</uri>
</include>


要让gazebo能够找到uri中的自建model,需要将

export GAZEBO_MODEL_PATH=~/<path>/my_package_example/models:${GAZEBO_MODEL_PATH}


写入~/.bashrc文件中。参考链接

链接中还提到了要找到gazebo plugin和resource需要需改的gazebo环境变量:

export GAZEBO_PLUGIN_PATH=~/<path>/my_package_example/lib:${GAZEBO_PLUGIN_PATH}

export GAZEBO_MODEL_PATH=~/<path>/my_package_example/models:${GAZEBO_MODEL_PATH}

export GAZEBO_RESOURCE_PATH=~/<path>/my_package_example/models:${GAZEBO_RESOURCE_PATH}

2. gazebo环境中批量放置物品:参考链接

在gazebo 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>

    <!-- Testing the automatic population of objects -->
    <population name="can_population1">
      <model name="can1">
        <include>
          <static>true</static>
          <uri>model://coke_can</uri>
        </include>
      </model>
      <pose>0 0 0 0 0 0</pose>
      <box>
        <size>2 2 0.01</size>
      </box>
      <model_count>10</model_count>
      <distribution>
        <type>random</type>
      </distribution>
    </population>

  </world>
</sdf>

使用tag population表示批量放置,而tag distribution控制批量放置模型的排列形式,有随机、成行、成列等方式。具体使用方法可以见参考链接。

3. 可视化编辑gazebo中的建筑环境:参考链接

这是gazebo中广为人知的建筑物建模方法,简单来说,通过gui,我们可以导入一张建筑物平面图,然后再按照平面图建立建筑物模型,支持多楼层建筑物,也可以添加楼梯、门窗等。