.
.
.
.
<.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>
<include>
<uri>model://school</uri>
<static>true</static>
<pose>-20 -10 0.3 0 0 3.14 </pose>
</include>
<include>
<uri>model://playground</uri>
<static>true</static>
<pose>10 10 0.3 0 0 3.14 </pose>
</include>
<!-- +X barriers -->
<population name="pine_tree_population">
<model name="pine_tree">
<include>
<static>true</static>
<uri>model://pine_tree</uri>
</include>
</model>
<pose>0 19 0.3 0 0 0</pose>
<box>
<size>40 40 0.01</size>
</box>
<model_count>20</model_count>
<distribution>
<type>linear-x</type>
</distribution>
</population>
<!-- -X barriers -->
<population name="pine_tree_population">
<model name="pine_tree_2">
<include>
<static>true</static>
<uri>model://pine_tree</uri>
</include>
</model>
<pose>10 5 0.3 0 0 0</pose>
<box>
<size>10 20 0.01</size>
</box>
<model_count>10</model_count>
<distribution>
<type>linear-x</type>
</distribution>
</population>
<!-- +Y barriers -->
<population name="pine_tree_population">
<model name="pine_tree_3">
<include>
<static>true</static>
<uri>model://pine_tree</uri>
<pose>0 0 0 0 0 1.57</pose>
</include>
</model>
<pose>19 10 0.3 0 0 0</pose>
<box>
<size>10 10 0.01</size>
</box>
<model_count>10</model_count>
<distribution>
<type>linear-y</type>
</distribution>
</population>
<!-- random models population -->
<population name="person_walking_population">
<model name="person_walking">
<include>
<static>false</static>
<uri>model://person_walking</uri>
</include>
</model>
<pose>0 0 0.2 0 0 0</pose>
<box>
<size>30 30 0.01</size>
</box>
<model_count>5</model_count>
<distribution>
<type>random</type>
</distribution>
</population>
<!-- random models population -->
<population name="oak_tree_population">
<model name="oak_tree">
<include>
<static>true</static>
<uri>model://oak_tree</uri>
</include>
</model>
<pose>0 0 0.2 0 0 0</pose>
<box>
<size>60 60 0.01</size>
</box>
<model_count>5</model_count>
<distribution>
<type>random</type>
</distribution>
</population>
</world>
</sdf>
.
.
roslaunch robot_description spawn.launch
로봇 배치! - 이건 그전 포스팅 로봇만들기 편 참고
방법은..
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
package가 없다는 에러가 난다면 설치가 안되어서 그럴 수 있으므로
terminal에서 설치를 해주면 된다.
이때 자신의 ros version에 맞게 melodic을 바꿔줘야한다.
melodic이면 아래처럼 적고 noetic이면 ros-noetic-teleop-twist-keyboard 이런식으로
sudo apt-get install ros-melodic-teleop-twist-keyboard
이제 키보드를 눌러 만든 world에서 자유롭게 이동하는 로봇을 구경하면 된다!
.
.