44Gazebo Simulator
55##############################
66
7- This setup tutorial will guide you through setting up your PC to run the simulated robot with the demos .
7+ This setup tutorial will guide you through setting up your PC to run the simulated robot on gazebo and some basics commands .
88
99
10- Make sure you check: :ref: `prerequisites `.
10+ Dependencies
11+ =======================
1112
12- Cloning Robotont's packages
13- -----------------------------
13+ Make sure you check: :ref: `prerequisites ` and you have cloned and tested robotont_description and robotont_nuc_description packages, you can find complete instructions on :ref: `visualize `.
1414
1515All Robotont's packages can be accessed from `Robotont's GitHub <https://github.com/robotont >`__.
1616
1717Packages necessary to run the Gazebo simulation with Robotont's demos are following:
1818
19- #. `robotont_description <https://github.com/robotont/robotont_description >`__
19+ #. `robotont_description <https://github.com/robotont/robotont_description >`__
2020
21- #. `robotont_nuc_description <https://github.com/robotont/robotont_nuc_description >`__
21+ #. `robotont_nuc_description <https://github.com/robotont/robotont_nuc_description >`__
2222
23- #. `robotont_gazebo <https://github.com/robotont/robotont_gazebo >`__
23+ #. `robotont_gazebo <https://github.com/robotont/robotont_gazebo >`__
2424
25- #. `robotont_navigation <https://github.com/robotont/robotont_navigation >`__
25+ #. `gz_planar_move <https://github.com/sygism/gz_planar_move >`__
2626
27- #. `robotont_msgs <https://github.com/robotont/robotont_msgs.git >`__
2827
29- You can find the demos from the following repositories :
28+ Install Gazebo Harmonic and the ROS ↔ Gazebo integration packages (required for simulation time ` /clock `, physics stepping, and Gazebo transport bridges), plus common Robotont description tools :
3029
31- #. `AR Demo Follow-the-leader <https://github.com/robotont-demos/ar_follow_the_leader.git >`__
32- #. `AR Steering <https://github.com/robotont-demos/ar_steering.git >`__
33- #. `Slam 2D <https://github.com/robotont-demos/demo_slam >`__
34- #. `Mapping 3D <https://github.com/robotont-demos/demo_mapping_3d.git >`__
30+ .. code-block :: bash
3531
36- See the :ref: `demos_on_gazebo ` for more information about the demos.
32+ sudo apt update
33+ sudo apt install -y \
34+ gz-harmonic \
35+ ros-jazzy-ros-gz \
36+ ros-jazzy-ros-gz-sim \
37+ ros-jazzy-ros-gz-bridge \
38+ ros-jazzy-xacro \
39+ ros-jazzy-robot-state-publisher
3740
38- To clone the packages, for example, robotont_description :
41+ After cloning the Robotont and ` gz_planar_move ` repositories into your workspace ` src/ `, install remaining dependencies with rosdep :
3942
4043.. code-block :: bash
41-
42- git clone https://github.com/robotont/robotont_description.git
4344
44- Building the colcon workspace
45- ------------------------------
45+ cd ~ colcon_ws
46+ rosdep update
47+ rosdep install --from-paths src --ignore-src -r -y
48+
4649
50+ Building and sourcing the colcon workspace
51+ =======================
4752.. code-block :: bash
4853
4954 cd colcon_ws
5055 colcon build
5156
52- Sourcing the workspace
53- -----------------------
5457
5558 Make the workspace visible to ROS 2 (must be done for every new terminal)
5659
@@ -66,8 +69,77 @@ For automatic sourcing:
6669
6770
6871 Running the Simulation
72+ =======================
73+
74+ Launch file arguments
6975---------------------
7076
77+ .. list-table ::
78+ :header-rows: 1
79+
80+ * - Name
81+ - Description
82+ - Options
83+ * - ``generation ``
84+ - Specify the generation of robotont model that is to be loaded
85+ - 2.1, 3 (default)
86+ * - ``model ``
87+ - Specify the model that is to be loaded into the world
88+ - robotont_gazebo_basic, robotont_gazebo_lidar, robotont_gazebo_nuc (default)
89+ * - ``world ``
90+ - Specify world the robot is spawned in
91+ - bangbang.sdf, between.sdf, colors.sdf, mapping.sdf, maze.sdf, minimaze.sdf, minimaze_ar.sdf, empty_world.sdf (default)
92+ * - ``x ``, ``y ``, ``z ``
93+ - Specify the robot's spawn pose
94+ - Number, 0 (default)
95+
96+ .. tip ::
97+
98+ For example, loading the generation 3 model in colors.sdf world at pose (-2, 1, 0):
99+
100+ .. code-block :: bash
101+
102+ ros2 launch robotont_gazebo gazebo.launch.py world:=colors.sdf x:=-2 y:=1
103+
104+ Worlds
105+ ------
106+
107+ .. list-table ::
108+ :header-rows: 1
109+
110+ * - World
111+ - Example
112+ - Launch Command
113+ * - minimaze.sdf
114+ - .. image:: /pictures/minimaze_world_example.png
115+ :width: 200px
116+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=minimaze.sdf ``
117+ * - bangbang.sdf
118+ - .. image:: /pictures/bangbang_world_example.png
119+ :width: 200px
120+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=bangbang.sdf ``
121+ * - between.sdf
122+ - .. image:: /pictures/between_world_example.png
123+ :width: 200px
124+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=between.sdf ``
125+ * - colors.sdf
126+ - .. image:: /pictures/colors_world_example.png
127+ :width: 200px
128+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=colors.sdf ``
129+ * - mapping.sdf
130+ - .. image:: /pictures/mapping_world_example.png
131+ :width: 200px
132+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=mapping.sdf ``
133+ * - maze.sdf
134+ - .. image:: /pictures/maze_world_example.png
135+ :width: 200px
136+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=maze.sdf ``
137+ * - minimaze_ar.sdf
138+ - .. image:: /pictures/minimaze_ar_world_example.png
139+ :width: 200px
140+ - ``ros2 launch robotont_gazebo gazebo.launch.py world:=minimaze_ar.sdf ``
141+
142+
71143After building and sourcing your workspace, you can spawn the robot in a gazebo world, for example:
72144
73145.. code-block :: bash
@@ -77,4 +149,17 @@ After building and sourcing your workspace, you can spawn the robot in a gazebo
77149 .. image :: /pictures/colors_world_example.png
78150 :width: 100%
79151
152+ Open a second terminal and use ``teleop_twist_keyboard `` to control the robot:
153+
154+ .. code-block :: bash
155+
156+ ros2 run teleop_twist_keyboard teleop_twist_keyboard
157+
158+ If everything worked correctly, you should see the following in your terminal:
159+
160+ .. image :: /pictures/teleop_screenshot.png
161+ :width: 100%
162+
163+ By pressing different keys in this terminal, you’ll see the robot move
80164Refer to individual demo package READMEs for more details on launching specific demos.
165+ See the :ref: `demos_on_gazebo ` for more information about the demos.
0 commit comments