GazeboにCADモデルを読み込む

ここを参考に
gazebosim.org

COLLADA形式(.dae)のファイルを読み込める。

CADからSTLでエクスポートし、Blenderでいったん読み込んだ後、.daeでエクスポートするのが良さそう。


1)CADでSTLにエクスポート
f:id:seinzumtode:20201122223132p:plain

2)Blenderにインポートして.daeでエクスポート
f:id:seinzumtode:20201122223222p:plain

3)Gazeboでロード
my_mesh.world

<?xml version="1.0"?>
<sdf version="1.4">
  <world name="default">
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://sun</uri>
    </include>
    <model name="my_mesh">
      <pose>0 0 0  0 0 0</pose>
      <static>true</static>
      <link name="body">
        <visual name="visual">
          <geometry>
            <mesh><uri>file://my_mesh.dae</uri></mesh>
          </geometry>
        </visual>
      </link>
    </model>
  </world>
</sdf>

Gazebo起動

$ gazebo my_mesh.world

f:id:seinzumtode:20201122222737p:plain