Population of models - modulabs/gazebo-tutorial GitHub Wiki
μ΄ μ§μΉ¨μλ λΉμ μ΄ SDF <population> tag μ μ΄μ©ν΄μ μ΄λ»κ² λͺ¨λΈμ 볡μ λ₯Ό ν μμμ§λ₯Ό 보μ¬μ€λλ€. 볡μ λ κ³ μ μ λͺ¨λΈλͺ¨μμΌλ‘ ꡬμ±μ΄ λμ΄μμ΅λλ€.
λͺ¨λΈλ³΅μ λ λ€μμ νλΌλ©νλ₯Ό μ ν©λλ€.
- λͺ¨λΈ(μ:ν μ΄λΈ, μ½λΌλ³)
- 볡μ λ₯Ό μνλ μ€λΈμ νΈμ
- μ€λΈμ νΈλ€μ΄ λ°°μ΄λ ννμ λλ©μ (μ:λ°μ€,μ€λ¦°λ)
- 볡μ 컨ν μ΄λμ μμΉμ λ°©ν₯
- μ½ν μ΄λμμ μ€λΈμ νΈμ λ°°ν¬(μ: 무μμ,GRID)
For reference, check the SDF specification for a complete specification of the tag and its parameters.
- μ΄ μ§μΉ¨μλ₯Ό μν΄ λλ ν 리λ₯Ό μμ±νλκ²μΌλ‘ μμνμΈμ
$ mkdir ~/tutorial_model_population
$ cd ~/tutorial_model_population
- μ΄νμΌμ νμ¬μ λλ ν 리μ λ€μ΄λ‘λ νμΈμ : can_population.world
$ wget http://bitbucket.org/osrf/gazebo_tutorials/raw/default/model_population/files/can_population.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> - κ°μ 보λ₯Ό μ€νν©λλ€.
$ gazebo can_population.world
λΉμ μ μλ€μΊμ 볡μ νμ 보κ²λ©λλ€( λλ€μΌλ‘ μμΉλμ΄ μλ) μ΄ μΊλ€μ BOX 컨ν μ΄λ (222 λ―Έν°)μ΄λ΄μ λ°°μ΄μ΄ λ©λλ€.
μ’λ κ°λ΄ μλ€. λ€λ₯Έ can_population.world μ μμλ₯Ό μ΄ν΄ν©λλ€.
<population name="can_population1">
<model name="can1">
<include>
<static>true</static>
<uri>model://coke_can</uri>
</include>
</model>μ΄ μ 보μμ μ°λ¦¬λ <population> tag.λ₯Ό μ΄μ©ν΄μ μ΄λ»κ² 볡μ νμ specμ΄ μ ν΄μ§λμ§ μμμμ΅λλ€.
λͺ¨λ 볡μ νμ κ³ μ μ μ΄λ¦μ κ°κ³ μμ΅λλ€.
μ΄κ²μ μ΄λ¦μμ±μΌλ‘ νΉμ μ§μ΄μ§λλ€.
볡μ νκ·Έ λ΄μμ, λΉμ°μ model tagλ‘ λͺ¨λΈμ μ΄λ»κ² μ ννλμ§ μμμμ΅λλ€.
κ° λ³΅μ νμ μμλ μ μΌν μ΄λ¦μΌλ‘ μλ¬Όλ μ΄μ
μΌλ‘ μ½μ
μ΄ λ©λλ€
μ΄λ¦μ _clone_i λΌλ μ΄λ¦μΌλ‘ μΆκ°κ° λ¨μΌλ‘μ¨ μμ±μ΄ λ©λλ€.
iλ 볡μ μμμ μλ² μ
λλ€.λΉμ μ 볡μ λ λͺ¨λΈμ 리μ€νΈλ₯Ό λ³Όμμμ΅λλ€
κ°μ₯ μΌλ°μ μΈ λ³΅μ νμ μ μλλ©μ΄μ μ΄ μλλ μ€λΈμ νΈλ‘ ꡬμ±λ©λλ€. μλ₯Όλ€λ©΄ λ무,λ°μ,λΉλ©λ±.
We recommend you use the <population> tag for static models, and exclude mobile entities, such as robots, which often require more precise placement and are fewer in number.
<pose>0 0 0 0 0 0</pose>
<box>
<size>2 2 0.01</size>
</box>μμ μ½λμ λΈλμ μ§μμ νΉμ νν©λλ€, κ·Έ μ§μ΅μ μ€λΈμ νΈκ° μμΉν μ§μμ λλ€. μ΄λ² κ²½μ°μμλ, λͺ¨λ μ€λΈμ κ·Έλ 3dκΈ°μ΄ λ°μ€(2 x 2 x 0.01 m, centered at (0, 0, 0) with orientation (0, 0, 0))μ 볡μ λμμ΅λλ€ As an alternative to , a region is also allowed by specifying its radius and length. (Check out the SDF specification for a full description of the parameters.) The element sets the reference frame of the population's region.
<model_count>10</model_count>
μμμ λΉμ μ λͺ¨λΈμ μλ₯Ό λ³Όμμμ΅λλ€ μ΄λ€ μμμ΄λ νμ©μ΄ λ©λλ€. κ·Έλ¬λ λ무λμ μλ μ±λ₯μ μ νμν΅λλ€.
<distribution>
<type>random</type>
</distribution>
μ μ€λΈμ νΈκ° μ§μμ μ΄λ»κ² λ°°μΉκ° λλμ§ μ€λͺ ν©λλ€.
- random : 무μμ μμΉλ‘ 볡μ λ¨
- uniform : λͺ¨λΈμ 2d ν¨ν΄μΌλ‘ μμΉν©λλ€. μ°λ¦¬λ k-meanμ μ΄μ©ν©λλ€. μ§μλ΄μ μμΉλ₯Ό μ΅μ ν ν©λλ€.
- grid : 2d grid patternμ μμΉν©λλ€. μ΄ λ°°ν¬λ λν λΉμ μ΄ rows nomber, col number, μ리먼νΈμ¬μ΄ 거리λ₯Ό νΉμ ν΄μΌ ν©λλ€. μ΄ <model_count> λ μ΄ λ°°ν¬μμ 무μλ©λλ€. μ€λΈμ νΈμ λ²νΈλ μλ¬Όλ μ΄μ μ μ½μ μ΄ λ©λλ€. μ΄ μλ¬Όλ μ΄μ μ ν,μ΄μ λλ²μ κ°κ²λ©λλ€.
- Linear -x : λͺ¨λΈμ xμΆμλ°λΌ rowλ‘ λ°°μΉλ©λλ€.
- Linear -y : λͺ¨λΈμ yμΆμλ°λΌ rowλ‘ λ°°μΉλ©λλ€.
- Linear -z : λͺ¨λΈμ zμΆμλ°λΌ rowλ‘ λ°°μΉλ©λλ€.
μ’λ λ§μ μ§λ³΄λ μμ λ₯Ό λΉμ μ population.world μμ λ³Όμμμ΅λλ€. κ·Έλ¦¬κ³ λ¬Όλ‘ λΉμ μ μ΄κ²μ ν μ€νΈν΄λ³Όμ μμ΅λλ€.
$ gazebo worlds/population.world

