Skip to content

Commit 518a5dc

Browse files
author
Séverin Lemaignan
committed
[doc] Added a 'quickstart' tutorial
It illustrates to use of 'morse create' and friends. Partially fix morse-simulator#396
1 parent 0a780f4 commit 518a5dc

File tree

5 files changed

+91
-5
lines changed

5 files changed

+91
-5
lines changed

doc/media/initial_sim.jpg

33.6 KB
Loading

doc/morse/quickstart.rst

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
MORSE quickstart
2+
================
3+
4+
Creating your first simulation with MORSE is easy.
5+
6+
First, the boring part:
7+
8+
- :doc:`Install MORSE<user/installation>`
9+
- Open a terminal and check everything is well configured
10+
11+
::
12+
13+
$ morse check
14+
15+
Then, the funny part::
16+
17+
$ morse create mysim
18+
$ morse run mysim
19+
20+
This should be enough to launch MORSE and display a sample simulation. You can
21+
already control the robot with the arrow keys and check collisions with
22+
surrounding objects. Press :kbd:`h` to display the list of keyboard shortcuts.
23+
24+
.. image:: ../media/initial_sim.jpg
25+
:align: center
26+
27+
So, what happened here?
28+
29+
`morse create mysim` actually created a new subfolder in the current directory.
30+
31+
If you inspect it, you will find a Python file called `default.py` and two
32+
folders. `default.py` is what we call a **Builder script** (because it uses MORSE's :doc:`Builder API<user/builder>`) and it describes your simulation.
33+
34+
.. note::
35+
Note that the script is still Python: besides the Builder API, you can use any
36+
standard Python constructs to program your simulation.
37+
38+
Open `default.py` in your favorite text editor. There are plenty of comments and
39+
it should be mostly self-explanatory: it builds a simulation with one robot,
40+
called *Morsy*, two actuators (including the keyboard for debugging/testing),
41+
one sensor, and these simulated components talk to the outside world via a
42+
socket.
43+
44+
By checking the :doc:`component library<components_library>`, you get a first
45+
glimpse on what standard robots, actuators and sensors are available *out of
46+
the box*. You can add new elements to your simulation by directly editing
47+
`default.py`.
48+
49+
.. note::
50+
All simulations in MORSE are (by default) self-contained. This means that you
51+
can share your simulation folder (zipping it, sharing with GIT, etc.) with
52+
others, they can import it with `morse import <path>` (only required the
53+
first time), and then run it exactly as you did. Convenient to work on a shared
54+
project.
55+
56+
What if you want to create a custom robot or a custom actuator/sensor?
57+
58+
::
59+
60+
$ morse add robot MyCustomRobot mysim
61+
62+
This will create a template for your robot. Open the robot description as
63+
hinted on the output. You will see that by default, your custom robot has the
64+
same two actuators and sensor as in `default.py`. You can change them to build
65+
a robot that match your need.
66+
67+
Check as well `morse add actuator` and `morse add sensor` if you need to create
68+
custom actuators/sensors.
69+
70+
That's all folks! You now know the basics of MORSE. Head to the
71+
:doc:`tutorials` section to learn how to interact with your simulated robots
72+
and for more advanced examples.
73+
74+
75+

doc/morse/tutorials.rst

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ may require some time to master.
99
However, you should hopefully be able to get very quickly your first
1010
simulation running.
1111

12+
If you did not check it, we recommend you to first go over the
13+
:doc:`Quickstart<quickstart>` page and come back here afterwards.
14+
15+
1216
What is the general workflow?
1317
-----------------------------
1418

doc/morse/user/builder.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Build your simulations
22
======================
33

4-
For a quick list of builder module methods, see the
4+
If you did not check it, we recommend you to first go over the
5+
:doc:`Quickstart<../quickstart>` page.
6+
7+
For a practical reference of the Builder API module methods, see the
58
:doc:`Builder Overview<builder_overview>`.
69

710
The Builder API
@@ -298,4 +301,4 @@ To modify the data of a component, just add the following line to
298301
your builder script::
299302

300303
pose.alter('Noise', pos_std=0.3)
301-
304+

doc/morse/user/installation.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ See their associated documentation for details.
6060

6161

6262
If you plan to use the simulator with raw sockets or text files as interface
63-
(for instance, to integrate MORSE with MatLab or other specific
64-
applications), you don't need anything else. Otherwise, you need to install
65-
the software for the desired middlewares:
63+
(for instance, to integrate MORSE with MatLab or other specific applications),
64+
you don't need anything else, and you can jump to MORSE's
65+
:doc:`Quickstart<../quickstart>`. Otherwise, you need to install the software
66+
for the desired middlewares:
6667

6768
.. toctree::
6869
:glob:
@@ -205,6 +206,9 @@ You can check your configuration is ok with::
205206
$ cd build
206207
$ make install
207208

209+
Time to jump to MORSE's :doc:`Quickstart<../quickstart>` tutorial!
210+
211+
208212
Installation troubleshooting
209213
----------------------------
210214

0 commit comments

Comments
 (0)