Skip to content

Commit 10c6854

Browse files
committed
Merged in guided_a (pull request #429)
Advanced guided tutorials! Approved-by: Carlos Agüero <[email protected]> Approved-by: Shane Loretz <[email protected]>
2 parents 57acd55 + 33b15cc commit 10c6854

File tree

10 files changed

+804
-5
lines changed

10 files changed

+804
-5
lines changed

building_editor/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ When a new level is added, a floor is automatically inserted. If there are stair
120120
121121
> **Tip:** Before adding a level, make sure you have walls on the current level to build on top of.
122122
123-
> **Tip:** Currently, all the walls from the level below are copied to the new level, with default materials. No other features are copied. You can manually delete the walls you don't want.
123+
> **Tip:** Currently, all the walls from the level below are copied to the new level, with default materials. No other features are copied. You can manually delete the walls you don't want.
124124
125125
[[file:files/add_level.png|800px]]
126126
@@ -170,7 +170,7 @@ We drew a lot of walls earlier, but maybe they didn't turn out exactly the way w
170170
171171
## Edit windows and doors
172172
173-
Now let's play around with windows and doors. As we did for the walls, we can manipulate windows and doors more precisely in a few different ways.
173+
Now let's play around with windows and doors. As we did for the walls, we can manipulate windows and doors more precisely in a few different ways.
174174
175175
* In the 2D View, click on the feature to be edited.
176176

guided_a/files/tut2_1.png

29.9 KB
Loading

guided_a/files/tut3_1.png

73.3 KB
Loading

guided_a/files/tut3_2.png

75.2 KB
Loading

guided_a/tutorial1.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Intro
2+
3+
Welcome to the Advanced Module! This module will guide you through the
4+
process of making a contribution to Gazebo's codebase! We will cover
5+
topics such as:
6+
7+
* Using Mercurial and Bitbucket to manage source files
8+
* Understanding the source code structure
9+
* Finding an issue to fix
10+
* Testing and documenting your code
11+
* Getting your code integrated into Gazebo!
12+
13+
Each tutorial builds upon the last, so we recommend following the tutorials in order.
14+
15+
These tutorials are intended for those with basic experience using Gazebo,
16+
Ubuntu Linux, and writing C++ code.
17+
18+
> **Note**: It's possible to contribute to Gazebo if you're using a different
19+
operating system, but for simplicity, this tutorial is focusing on Ubuntu users.
20+
21+
# Where is Gazebo's source code?
22+
23+
Gazebo is an open source project, and as such, its source code is publicly
24+
available online. It is currently hosted on a mercurial repository at Bitbucket:
25+
26+
[https://bitbucket.org/osrf/gazebo/](https://bitbucket.org/osrf/gazebo/)
27+
28+
If none of that makes sense to you, let's go through some important concepts:
29+
30+
## Mercurial
31+
32+
[**Mercurial**](https://www.mercurial-scm.org/) is a version control software used to
33+
keep track of changes made to source code. Some might be familiar with a similar
34+
tool called **Git**.
35+
36+
This tutorial series won't be going into detail about how mercurial works, but
37+
each mercurial command (`hg`) used will be explained.
38+
39+
> If you're completely new to version control, there's a lot of good information
40+
available online, such as [this](https://www.youtube.com/watch?v=idd2fmPRRlU)
41+
tutorial series.
42+
43+
## Bitbucket
44+
45+
[**Bitbucket**](https://bitbucket.org) is the website used to host the mercurial
46+
repository so that the source code has a central place to live.
47+
48+
In order to contribute to Gazebo, you'll need to create an account there, by
49+
following [this link](https://bitbucket.org/account/signup/).
50+
51+
# Where is the rest of the code?
52+
53+
You might be asking, is this it, is that all the code needed to bring Gazebo
54+
to life? Well, not exactly. Gazebo, as most software, takes advantage of other
55+
existing libraries to perform specific tasks. These are called _dependencies_.
56+
57+
For example, Gazebo uses [Ogre](http://www.ogre3d.org/) for rendering,
58+
[Qt](https://www.qt.io/) for the graphical user interface and supports a few
59+
physics engines, such as [ODE](http://www.ode.org/) and
60+
[Bullet](http://bulletphysics.org/wordpress/). That's only to name a few.
61+
62+
Among Gazebo's dependencies, there are some dependencies which are maintained
63+
by the Gazebo core team. Gazebo development is often tied to the development of
64+
these libraries, so everything that will be discussed on this series also
65+
applies to those libraries. All these libraries are hosted on Bitbucket using
66+
mercurial. They are the following:
67+
68+
## SDFormat
69+
70+
SDF is an XML file format that describes worlds used by simulators
71+
such as Gazebo. The SDF library is used to parse these files and provide a
72+
C++ interface.
73+
74+
* Source code: [https://bitbucket.org/osrf/sdformat](https://bitbucket.org/osrf/sdformat)
75+
76+
## Ignition Math
77+
78+
Ignition Math is a small, fast, and high performance math library. This library
79+
is a self-contained set of classes and functions suitable for robot applications.
80+
81+
* Source code: [https://bitbucket.org/ignitionrobotics/ign-math/](https://bitbucket.org/ignitionrobotics/ign-math/)
82+
83+
## Ignition Transport
84+
85+
Ignition Transport combines ZeroMQ with Protobufs to create a fast and
86+
efficient message passing system. Asynchronous message publication and
87+
subscription is provided along with service calls and discovery.
88+
89+
* Source code: [https://bitbucket.org/ignitionrobotics/ign-transport/](https://bitbucket.org/ignitionrobotics/ign-transport/)
90+
91+
## Ignition Messages
92+
93+
Ignition Messages provides a standard set of message definitions, used by
94+
Ignition Transport, and other applications.
95+
96+
* Source code: [https://bitbucket.org/ignitionrobotics/ign-msgs/](https://bitbucket.org/ignitionrobotics/ign-msgs/)
97+

guided_a/tutorial2.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Run your own copy of Gazebo
2+
3+
On the [previous tutorial](http://gazebosim.org/tutorials?tut=guided_a1)
4+
we covered where to find the source code for Gazebo and other dependencies.
5+
6+
This tutorial will go through the process of getting your own copy of the
7+
code running.
8+
9+
## Fork it!
10+
11+
We previously showed that Gazebo's source code lives on a mercurial
12+
[repository](https://bitbucket.org/osrf/gazebo) on Bitbucket. But even though
13+
everyone in the world is able to see and copy that code, only the Gazebo core
14+
team has write access to it.
15+
16+
In order to modify the code, you'll need to get your own copy, which is called
17+
a "fork". You can fork Gazebo as follows:
18+
19+
1. Click on [this link](https://bitbucket.org/osrf/gazebo/fork)
20+
1. You can choose a custom name for the repository, but here we will leave the
21+
default value `gazebo`.
22+
1. After you finish the fork process, you should have a copy of Gazebo on
23+
`https://bitbucket.org/<yourname>/gazebo`.
24+
25+
> **Note**: Throughout these tutorials, substitute `<yourname>` with your
26+
Bitbucket account username.
27+
28+
## Clone
29+
30+
Great, now you have a copy of the code, but it's not very convenient to
31+
interact with it through the browser. You want to have it in your computer.
32+
You will use the mercurial command line tool to pull that code from the internet
33+
to your computer as follows:
34+
35+
1. Make sure you have mercurial (`hg`) installed:
36+
37+
sudo apt update
38+
sudo apt install mercurial
39+
40+
1. It's a good idea to create a directory to hold the source code, so:
41+
42+
mkdir ~/code
43+
cd ~/code
44+
45+
1. Now we use mercurial to "clone" our fork. What the clone command does is
46+
copy all the code across all branches from the internet to your computer.
47+
Gazebo has a large codebase, so this process may take a while depending on
48+
your internet connection:
49+
50+
hg clone https://bitbucket.org/<yourname>/gazebo
51+
52+
1. Now you should have a local copy of Gazebo under `~/code/gazebo`. Let's
53+
move to that folder and list its contents:
54+
55+
cd ~/code/gazebo
56+
ls
57+
58+
1. You should see something like this:
59+
60+
[[file:files/tut2_1.png|800px]]
61+
62+
## Branches
63+
64+
Gazebo's code is organized into different branches with different purposes.
65+
66+
1. Let's take a look at all existing branches using the mercurial command
67+
"branches":
68+
69+
cd ~/code/gazebo
70+
hg branches
71+
72+
1. You'll see a long list which looks something like this:
73+
74+
gazebo7 34485:8a11f7f5192d
75+
harness_detach_race 34483:61e3130bc8ac
76+
gazebo8 34480:bec999d7b4f5
77+
default 34478:33a2f98c192b
78+
contact_sensor_active 34442:6f5bbf8258d0
79+
harness_attach_default 34441:3316f27cf2c8
80+
ardupilot_merge_gazebo8 34419:1df2ecb57e53
81+
collision_pose_noncanonical 34393:57c8ae067a61
82+
wind_patch_8a 34372:e6e53633700a
83+
issue_2049_7 34319:cc19fc0a7894
84+
...
85+
86+
1. On the left you have branch names, and on the right the id of the latest
87+
commit on that branch.
88+
89+
Most of the branches in Gazebo are branches where the core team is working
90+
on fixing bugs or adding new features. But a few branches have special meaning,
91+
these are:
92+
93+
* `default`: This is the bleeding edge code where all new features are being
94+
developed. You're automatically on this branch when you clone Gazebo. This
95+
is where new features and code that is incompatible with previous releases
96+
(i.e. breaks API/ABI) will go.
97+
98+
* `gazebo<N>`: Here, `N` is a number representing a Gazebo release. For example,
99+
the code for the latest release of Gazebo 7 is found on branch `gazebo7`.
100+
101+
## Build
102+
103+
Cool, now we have all the code, let's build our own copy of Gazebo!
104+
105+
> **Note**: This tutorial goes over the most basic installation. If you need
106+
some special configuration, check out the full
107+
[install from source tutorial](http://gazebosim.org/tutorials?tut=install_from_source&cat=install).
108+
109+
1. Setup your computer to accept software from packages.osrfoundation.org.
110+
111+
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
112+
113+
1. Setup keys and update
114+
115+
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
116+
sudo apt-get update
117+
118+
1. Install dependencies
119+
120+
wget https://bitbucket.org/osrf/release-tools/raw/default/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh
121+
ROS_DISTRO=dummy . /tmp/dependencies.sh
122+
sudo apt-get install $(sed 's:\\ ::g' <<< $BASE_DEPENDENCIES) $(sed 's:\\ ::g' <<< $GAZEBO_BASE_DEPENDENCIES)
123+
124+
1. Make sure you're at the source code root directory:
125+
126+
cd ~/code/gazebo
127+
128+
1. Make a build directory and go there
129+
130+
mkdir build
131+
cd build
132+
133+
1. Configure and build. This will take a while (easily more than one hour),
134+
leave it running and go watch some cool
135+
[Gazebo videos](https://www.youtube.com/results?search_query=gazebo+simulator).
136+
137+
cmake ..
138+
make -j4
139+
140+
1. Once that's done, install Gazebo:
141+
142+
sudo make install
143+
144+
1. Now you can try your installation:
145+
146+
gazebo --verbose
147+
148+
## Check the installation
149+
150+
If you've installed Gazebo on your system before, you might be asking
151+
how do you know if you're running your own copy of Gazebo, or the one you
152+
had previously installed. A quick trick to figure that out is to:
153+
154+
1. Check where you're running Gazebo from:
155+
156+
which gazebo
157+
158+
1. This will give you something like:
159+
160+
/usr/local/bin/gazebo
161+
162+
1. Now check where you're installing Gazebo to. You can do this by re-running
163+
install and looking for the install location, for example:
164+
165+
cd ~/code/gazebo/build
166+
sudo make install | grep /gazebo$
167+
168+
1. You'll see something like:
169+
170+
-- Up-to-date: /usr/local/bin/gazebo
171+
172+
1. If the paths from both commands match, you're running your own copy!
173+

0 commit comments

Comments
 (0)