population
을 이용하여 World를 제작해 보았다.
population
의 다양한 패턴을 사용하여 물체를 배치해보았다.
random
, grid
, linear
과 같은 패턴이 존재하는데,
각각의 tag
의 사용법을 좀더 익힐 수 있었다.
만든 world에 robot
을 소환시켜 camera
토픽에 어떤식으로 보이는지 확인하였다.
아래의 링크에서 카메라 토픽의 화면을 확인 할 수 있다.
실습 영상 -> https://www.youtube.com/watch?v=zjq92hpUuFU&ab_channel=Nodazi
🌍test_world.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>
<!-- ground -->
<population name="ground">
<model name="ground">
<include>
<static>true</static>
<uri>model://asphalt_plane</uri>
</include>
</model>
<pose>0 0 0.01 0 0 0</pose>
<distribution>
<type>grid</type>
<rows>2</rows>
<cols>2</cols>
<step>20 20 0.0</step>
</distribution>
</population>
<!-- brick_box_3x1x3 walls -->
<!-- +X brick_box_3x1x3 -->
<population name="brick_box_3x1x3">
<model name="brick_box_3x1x3_1">
<include>
<static>true</static>
<uri>model://brick_box_3x1x3</uri>
</include>
</model>
<pose>1.5 12.5 0.3 0 0 0</pose>
<box>
<size>30 30 0.01</size>
</box>
<model_count>10</model_count>
<distribution>
<type>linear-x</type>
</distribution>
</population>
<!-- -X brick_box_3x1x3 -->
<population name="brick_box_3x1x3">
<model name="brick_box_3x1x3_2">
<include>
<static>true</static>
<uri>model://brick_box_3x1x3</uri>
</include>
</model>
<pose>1.5 -12.5 0.3 0 0 0</pose>
<box>
<size>30 30 0.01</size>
</box>
<model_count>10</model_count>
<distribution>
<type>linear-x</type>
</distribution>
</population>
<!-- +Y brick_box_3x1x3 -->
<population name="brick_box_3x1x3">
<model name="brick_box_3x1x3_3">
<include>
<static>true</static>
<uri>model://brick_box_3x1x3</uri>
<pose>0 0 0 0 0 1.57</pose>
</include>
</model>
<pose>14.5 1.5 0.3 0 0 0</pose>
<box>
<size>24 24 0.01</size>
</box>
<model_count>8</model_count>
<distribution>
<type>linear-y</type>
</distribution>
</population>
<!-- +Y brick_box_3x1x3 -->
<population name="brick_box_3x1x3">
<model name="brick_box_3x1x3_4">
<include>
<static>true</static>
<uri>model://brick_box_3x1x3</uri>
<pose>0 0 0 0 0 1.57</pose>
</include>
</model>
<pose>-14.5 1.5 0.3 0 0 0</pose>
<box>
<size>24 24 0.01</size>
</box>
<model_count>8</model_count>
<distribution>
<type>linear-y</type>
</distribution>
</population>
<!-- random models population -->
<population name="construction_barrel_population">
<model name="construction_barrel">
<include>
<static>false</static>
<uri>model://construction_barrel</uri>
</include>
</model>
<pose>8.5 5 0.2 0 0 0</pose>
<box>
<size>10 5 0.01</size>
</box>
<model_count>15</model_count>
<distribution>
<type>uniform</type>
</distribution>
</population>
<!-- coke_can_random -->
<population name="coke_can_random">
<model name="coke_can">
<include>
<static>false</static>
<uri>model://coke_can</uri>
</include>
</model>
<pose>-8.5 -5 0.2 0 0 0</pose>
<box>
<size>5 5 0.01</size>
</box>
<model_count>100</model_count>
<distribution>
<type>random</type>
</distribution>
</population>
<!-- dumpster -->
<population name="dumpster">
<model name="dumpster">
<include>
<static>false</static>
<uri>model://dumpster</uri>
<pose>0 0 0 0 0 1.57</pose>
</include>
</model>
<pose>-11.8 -4 0.1 0 0 0</pose>
<box>
<size>10 12 0.01</size>
</box>
<model_count>4</model_count>
<distribution>
<type>linear-y</type>
</distribution>
</population>
<!-- double_pendulum_with_base -->
<population name="double_pendulum_with_base_random">
<model name="double_pendulum_with_base">
<include>
<static>false</static>
<uri>model://double_pendulum_with_base</uri>
</include>
</model>
<pose>8.5 -5 0.2 0 0 0</pose>
<box>
<size>10 10 0.01</size>
</box>
<model_count>10</model_count>
<distribution>
<type>random</type>
</distribution>
</population>
</world>
</sdf>