Skip to content

Commit c2d8b19

Browse files
miriamVeix123
authored andcommitted
update gazebo
1 parent da910ab commit c2d8b19

2 files changed

Lines changed: 116 additions & 109 deletions

File tree

source/demo_gazebo.rst

Lines changed: 9 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,19 @@ Demos on Gazebo
55
###############
66

77
Before running the demos it is necessary to get acquainted with the setup section of the documentation.
8-
Make sure you check: :ref:`setup_pc_only`
8+
Make sure you check: :ref:`prerequisites`.
99

10-
Launching the Simulation
11-
------------------------
12-
#. Clone the ``robotont_gazebo`` package into your workspace:
13-
14-
.. code-block:: bash
15-
16-
git clone https://github.com/robotont/robotont_gazebo.git
17-
18-
#. Build and source the newly added package:
19-
20-
.. code-block:: bash
21-
22-
colcon build --packages-select robotont_gazebo
23-
source install/setup.bash
24-
25-
#. Launch the simulator using the launch file:
10+
You can find the demos from the following repositories:
2611

27-
.. code-block:: bash
28-
29-
ros2 launch robotont_gazebo gazebo.launch.py
30-
31-
32-
Launch file arguments
33-
---------------------
34-
35-
.. list-table::
36-
:header-rows: 1
37-
38-
* - Name
39-
- Description
40-
- Options
41-
* - ``generation``
42-
- Specify the generation of robotont model that is to be loaded
43-
- 2.1, 3 (default)
44-
* - ``model``
45-
- Specify the model that is to be loaded into the world
46-
- robotont_gazebo_basic, robotont_gazebo_lidar, robotont_gazebo_nuc (default)
47-
* - ``world``
48-
- Specify world the robot is spawned in
49-
- bangbang.sdf, between.sdf, colors.sdf, mapping.sdf, maze.sdf, minimaze.sdf, minimaze_ar.sdf, empty_world.sdf (default)
50-
* - ``x``, ``y``, ``z``
51-
- Specify the robot's spawn pose
52-
- Number, 0 (default)
12+
#. `AR Demo Follow-the-leader <https://github.com/robotont-demos/ar_follow_the_leader.git>`__
13+
#. `AR Steering <https://github.com/robotont-demos/ar_steering.git>`__
14+
#. `Slam 2D <https://github.com/robotont-demos/demo_slam>`__
15+
#. `Mapping 3D <https://github.com/robotont-demos/demo_mapping_3d.git>`__
5316

54-
.. tip::
55-
56-
For example, loading the generation 3 model in colors.sdf world at pose (-2, 1, 0):
57-
58-
.. code-block:: bash
17+
Launching the Simulation
18+
------------------------
5919

60-
ros2 launch robotont_gazebo gazebo.launch.py world:=colors.sdf x:=-2 y:=1
61-
62-
Worlds
63-
------
64-
65-
.. list-table::
66-
:header-rows: 1
67-
68-
* - World
69-
- Example
70-
- Launch Command
71-
* - minimaze.sdf
72-
- .. image:: /pictures/minimaze_world_example.png
73-
:width: 200px
74-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=minimaze.sdf``
75-
* - bangbang.sdf
76-
- .. image:: /pictures/bangbang_world_example.png
77-
:width: 200px
78-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=bangbang.sdf``
79-
* - between.sdf
80-
- .. image:: /pictures/between_world_example.png
81-
:width: 200px
82-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=between.sdf``
83-
* - colors.sdf
84-
- .. image:: /pictures/colors_world_example.png
85-
:width: 200px
86-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=colors.sdf``
87-
* - mapping.sdf
88-
- .. image:: /pictures/mapping_world_example.png
89-
:width: 200px
90-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=mapping.sdf``
91-
* - maze.sdf
92-
- .. image:: /pictures/maze_world_example.png
93-
:width: 200px
94-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=maze.sdf``
95-
* - minimaze_ar.sdf
96-
- .. image:: /pictures/minimaze_ar_world_example.png
97-
:width: 200px
98-
- ``ros2 launch robotont_gazebo gazebo.launch.py world:=minimaze_ar.sdf``
20+
Make sure you have already set up the simulation following the steps described in :ref:`gazebo_simulator`.
9921

10022

10123
2D Mapping and Localization

source/gazebo_simulator.rst

Lines changed: 107 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,56 @@
44
Gazebo 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

1515
All Robotont's packages can be accessed from `Robotont's GitHub <https://github.com/robotont>`__.
1616

1717
Packages 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+
71143
After 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
80164
Refer 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

Comments
 (0)