加入模型 - tychien/gazebo_tutorial_zh GitHub Wiki
官方釋出的一些可用的模型
可以先下載下來,將模型一一放入/usr/share/gazebo-9/models
中
本次範例我們將加入postbox
編輯我們上一節提到的empty_world.world
檔案
加入這五行在 <world>
及</world>
之間即可
<include>
<uri>model://postbox</uri>
<pose>2 3 4 3 -1 2</pose>
<static>false</static>
</include>
<uri>
使gazebo找到模型的檔案位址
<pose>
定義模型在gazebo中的物理位置,x y z R P Y,以公尺為單位
<static>
如果為true則物體不會受到外力影響,如果為false,則物體可能會因為重力或海流而移動。若不加入這行,默認是true。
存檔後roslaunch my_simulations my_world.launch
開啟我們新建立的環境
由於我們在my_world.launch中設定一開始為pause,因此會看到postbox正漂浮在半空中。點擊gazebo中的播放鍵,postbox就會從空中墜落。