Skip to content

Commit 6fa185f

Browse files
committed
Merge pull request #158 from hamishwillee/tmp_guide_restructure
Restructure to getting started and removal of quickstart
2 parents 0f1fcf5 + e6dac36 commit 6fa185f

File tree

10 files changed

+162
-199
lines changed

10 files changed

+162
-199
lines changed

docs/about/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Open source community
1313
DroneKit-Python is an open source and community-driven project.
1414

1515
You can find all the source code on `Github here <https://github.com/diydrones/dronekit-python>`_ and check out our permissive :doc:`Apache v2 Licence <license>`.
16-
If you want to join the community, then see our :doc:`contributing page <contributing>` for lots of ideas on how you can help.
16+
If you want to join the community, then see our :doc:`contributing section <contributing>` for lots of ideas on how you can help.
1717

1818

1919
Compatibility

docs/contributing/developer_setup_windows.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Building DroneKit-Python on Windows
55
===================================
66

77
The setup for *developing* DroneKit-Python on Windows is almost the same as for *using*
8-
DroneKit-Python. We therefore recommend that you start by following the instructions in the :ref:`get-started` and/or
9-
:ref:`quick-start`.
8+
DroneKit-Python. We therefore recommend that you start by following the instructions in the :ref:`get-started`.
109

1110
When you've got DroneKit and a vehicle (simulated or real) communicating, you can
1211
then build and install your own fork of DroneKit, as discussed below.

docs/examples/running_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Running the Examples
33
====================
44

5-
To run the examples you will need to set up DroneKit as described in :ref:`get-started` or the :ref:`quick-start`.
5+
To run the examples you will need to set up DroneKit as described in :ref:`get-started`.
66
Once you have the `source code <https://github.com/diydrones/dronekit-python/tree/master/example>`_, examples are
77
started as described in the *Getting Started* section :ref:`getting-started-running_examples`.
88

docs/examples/simple_goto.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ to use more appropriate positions for your own vehicle.
2323
Running the example
2424
===================
2525

26-
The vehicle and DroneKit should be set up as described in the :ref:`quick-start` or :ref:`get-started`.
26+
The vehicle and DroneKit should be set up as described in :ref:`get-started`.
2727

2828
If you're using a simulated vehicle, remember to :ref:`disable arming checks <disable-arming-checks>` so
2929
that the example can run.

docs/examples/vehicle_state.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ should be used.
1414
Running the example
1515
===================
1616

17-
The vehicle and DroneKit should be set up as described in the :ref:`quick-start` or :ref:`get-started`.
17+
The vehicle and DroneKit should be set up as described in :ref:`get-started`.
1818
If you're using a simulated vehicle, remember to :ref:`disable arming checks <disable-arming-checks>` so
1919
that the example can run.
2020

docs/guide/getting_started.rst

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,24 @@
44
Getting Started
55
===============
66

7-
DroneKit-Python apps are typically run on Linux-based :ref:`companion computers <supported-companion-computers>` that travel on the vehicle and communicate with the autopilot via a serial port. However, it is usually easier to first prototype your app on a standard Mac, Windows, or Linux computer using a simulated autopilot. The instructions in this document apply to both scenarios.
7+
DroneKit-Python apps are typically run on Linux-based *companion computers* that travel
8+
on the vehicle and communicate with the autopilot via a serial port. However, during development it is usually easier to
9+
prototype apps on a standard Mac, Windows, or Linux computer using a *simulated* autopilot.
810

9-
.. tip:: If you want to develop for *DroneKit* on Windows using a simulated autopilot, our :ref:`quick-start` shows how to get up and running fast!
1011

12+
This topic explains how to set up and run DroneKit-Python (within MAVProxy) on the different host operating systems
13+
and then run a basic DroneKit app.
1114

12-
Setting up the vehicle/autopilot
13-
=================================
1415

15-
The topic :ref:`supported-companion-computers` has links to a number of tested hardware/software configurations for onboard Linux computers. These
16-
include information about how to set up the hardware and physically connect to the vehicle.
1716

18-
If you wish to use a simulated vehicle, the Software-In-The-Loop (SITL) environment can be used to simulate a Copter, Plane, or Rover. It runs natively on Linux,
19-
but can also run on Linux hosted in a virtual machine:
2017

21-
* `Setting up SITL on Linux <http://dev.ardupilot.com/wiki/setting-up-sitl-on-linux/>`_ (for Linux).
22-
* :ref:`QuickStart: Set up the simulated vehicle <vagrant-sitl-from-full-image>` (for Windows or Mac OSX).
18+
Setting up the vehicle/autopilot
19+
================================
2320

24-
.. note::
21+
For information on how to set up a vehicle (real and simulated) see:
2522

26-
The method used in the QuickStart is fast and reliable because it uses Vagrant to load an image that is pre-built and fully configured with SITL.
27-
Other approaches are described in the wiki topics `Setting up SITL using Vagrant <http://dev.ardupilot.com/wiki/simulation-2/sitl-simulator-software-in-the-loop/setting-up-sitl-using-vagrant/>`_
28-
and `Setting up SITL on Windows <http://dev.ardupilot.com/wiki/simulation-2/sitl-simulator-software-in-the-loop/setting-up-sitl-on-windows/>`_.
23+
* :ref:`supported-companion-computers` for links to tested hardware/software configurations for a number of onboard Linux computers.
24+
* :ref:`sitle_setup` for links explaining how to set up a simulated vehicle for Copter, Plane, or Rover.
2925

3026

3127

@@ -70,6 +66,7 @@ If you're on Mac OSX, you can use `Homebrew <http://brew.sh/>`_ to install *WXMa
7066
7167
brew tap homebrew/science
7268
brew install wxmac wxpython opencv
69+
7370
7471
Uninstall *python-dateutil* (OSX and Windows come bundled with a version that is not supported for some dependencies):
7572

@@ -94,15 +91,19 @@ You will need remove *python-dateutil* as the installation comes bundled with a
9491

9592
The steps to install this package and our add-on modules are:
9693

97-
1. Run the correct `WinPython installer <http://sourceforge.net/projects/winpython/files/WinPython_2.7/2.7.6.4/>`_ (**v2.7**) for your platform (win32 vs win64)
94+
#. Download and run the correct `WinPython installer <http://sourceforge.net/projects/winpython/files/WinPython_2.7/2.7.6.4/>`_ (**v2.7**) for your platform (win32 vs win64).
95+
96+
* Run the installer as an administrator (**Right-click** on file, select **Run as Administrator**).
97+
* When prompted for the destination location, specify **C:\Program Files (x86)**
98+
(the default location is under the Downloads folder).
9899

99-
2. Register the python that came from *WinPython* as the preferred interpreter for your machine:
100+
#. Register the python that came from *WinPython* as the preferred interpreter for your machine:
100101

101102
Open the folder where you installed WinPython, run *WinPython Control Panel* and choose **Advanced/Register Distribution**.
102103

103104
.. image:: http://dev.ardupilot.com/wp-content/uploads/sites/6/2014/03/Screenshot-from-2014-09-03-083816.png
104105

105-
3. Install DroneKit-Python and its remaining dependencies (including `MAVProxy <http://tridge.github.io/MAVProxy/>`_) from the public PyPi repository:
106+
#. Install DroneKit-Python and its remaining dependencies (including `MAVProxy <http://tridge.github.io/MAVProxy/>`_) from the public PyPi repository:
106107

107108
Open the *WinPython Command Prompt* and run the following two commands:
108109

@@ -129,7 +130,7 @@ Launch *MAVProxy* with the correct options for talking to your vehicle (simulate
129130
- ``mavproxy.py --master=/dev/ttyUSB0``
130131
* - Linux computer connected to the vehicle via Serial port (RaspberryPi example)
131132
- ``mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600``
132-
* - SITL Linux connected to the vehicle via UDP
133+
* - SITL connected to the vehicle via UDP
133134
- ``mavproxy.py --master=127.0.0.1:14550``
134135
* - OSX computer connected to the vehicle via USB
135136
- ``mavproxy.py --master=/dev/cu.usbmodem1``
@@ -145,8 +146,9 @@ For other connection options see the `MAVProxy documentation <http://tridge.gith
145146
Loading DroneKit
146147
================
147148

148-
*DroneKit* is implemented as a *MAVProxy* module. You can automatically load this module into *MAVProxy*
149-
by `adding it to the startup script <http://tridge.github.io/MAVProxy/mavinit.html>`_ (**mavinit.scr**).
149+
*DroneKit* is implemented as a *MAVProxy* module (MAVProxy is installed automatically with DroneKit).
150+
The best way to load the *DroneKit* module into *MAVProxy* is to
151+
`add it to the startup script <http://tridge.github.io/MAVProxy/mavinit.html>`_ (**mavinit.scr**).
150152

151153
Linux/MAC OSX:
152154

@@ -213,34 +215,3 @@ The output should look something like that shown below
213215
Waiting for mode change ...
214216
Got MAVLink msg: COMMAND_ACK {command : 11, result : 0}
215217
...
216-
217-
218-
219-
.. _viewing_uav_on_map:
220-
221-
Watching the action
222-
====================
223-
224-
Watching your DroneKit script run inside *MAVProxy* is useful, but you can go one step further and watch the behaviour of your simulated vehicle in *Mission Planner*.
225-
226-
To do this you first need to get SITL to output to an additional UDP port of your computer:
227-
228-
* Find the network IP address of your Windows computer (you can get this by running *ipconfig* in the *Windows Command Prompt*).
229-
* In the command prompt *for your simulated environment* (SITL), add the IP address of the host computer (e.g. 192.168.2.10) and an unused port (e.g. 145502) as an output:
230-
231-
.. code:: bash
232-
233-
output add 192.168.2.10:14552
234-
235-
Then connect Mission Planner to this UDP port:
236-
237-
* `Download and install Mission Planner <http://ardupilot.com/downloads/?did=82>`_
238-
* Ensure the selection list at the top right of the Mission Planner screen says *UDP* and then select the **Connect** button next to it.
239-
When prompted, enter the port number (in this case 14552).
240-
241-
.. figure:: MissionPlanner_ConnectPort.png
242-
:width: 50 %
243-
244-
Mission Planner: Listen Port Dialog
245-
246-
After connecting, vehicle parameters will be loaded into *Mission Planner* and the vehicle is displayed on the map.

docs/guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The guide contains how-to documentation for using the DroneKit-Python API. These
1010

1111
getting_started
1212
companion-computers
13+
Simulated Vehicle <sitl_setup>
1314
vehicle_state_and_parameters
1415
taking_off
1516
debugging

docs/guide/sitl_setup.rst

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
.. _sitle_setup:
2+
3+
=====================================
4+
Setting up a Simulated Vehicle (SITL)
5+
=====================================
6+
7+
The `SITL (software in the loop) <http://dev.ardupilot.com/wiki/simulation-2/sitl-simulator-software-in-the-loop/>`_
8+
simulator allows you to create and test DroneKit-Python apps without a real vehicle (and from the comfort of
9+
your own developer desktop!)
10+
11+
SITL runs natively on Linux and Windows, or within a virtual machine on Mac OSX, Linux or Windows. It can be
12+
installed on the same computer as DroneKit, or on another computer on the same network.
13+
14+
The sections below explain how set up SITL for the different operating systems,
15+
and how you can set up SITL to connect to Mission Planner and DroneKit at the same time.
16+
17+
Setting up SITL on Linux
18+
========================
19+
20+
Build and install SITL on Linux using the instructions in:
21+
`Setting up SITL on Linux <http://dev.ardupilot.com/wiki/setting-up-sitl-on-linux/>`_ (ArduPilot wiki)
22+
23+
24+
Setting up SITL on Windows
25+
==========================
26+
27+
Build and install SITL on Windows using the instructions in:
28+
`Setting up SITL on Windows <http://dev.ardupilot.com/wiki/simulation-2/sitl-simulator-software-in-the-loop/sitl-native-on-windows/>`_
29+
(ArduPilot wiki)
30+
31+
32+
.. _vagrant-sitl-from-full-image:
33+
34+
Set up SITL using Vagrant (MacOS)
35+
=================================
36+
37+
This section shows how to bring up a pre-built SITL instance hosted in a `Vagrant <https://www.vagrantup.com/>`_
38+
virtual machine. This approach should be used if you need to run SITL on MacOS. It can also be used for Windows
39+
and Linux (though we recommend the native installations linked above).
40+
41+
.. warning::
42+
43+
The Vagrant virtual machine is "headless" (has no UI) and so SITL cannot display the MAVProxy map and console.
44+
You can still see and send messages in the SITL Command Prompt.
45+
46+
47+
#. Get the software for hosting the Simulator onto your computer (Windows, OS-X and Linux are supported):
48+
49+
* `Download and install VirtualBox <https://www.virtualbox.org/wiki/Downloads>`_.
50+
* `Download and install Vagrant <https://www.vagrantup.com/downloads.html>`_.
51+
52+
#. Install SSH (Windows only - SSH is present by default on Linux/Mac OSX)
53+
54+
* Download and install `Git for Windows <https://git-scm.com/download/win>`_ (or another client that comes with SSH).
55+
After installing you can locate the file using the command ``C:\where ssh`` (normally it is installed to **C:\Program Files (x86)\Git\bin\ssh.exe**
56+
* Add the ssh.exe location to the *Path* (**System Properties | Advanced tab | Environment Variables | Path**)
57+
58+
#. Create a new directory where you will run *Vagrant*, and open a command prompt/terminal in it:
59+
60+
#. Enter the following commands to fetch a *Vagrantfile* for the pre-built SITL image:
61+
62+
.. code:: bash
63+
64+
vagrant init 3drobotics/ardupilot-sitl
65+
66+
#. Launch the new image. This takes a long time the *first time* it is run while it downloads the image from the Internet.
67+
68+
.. code:: bash
69+
70+
vagrant up
71+
72+
#. SSH into the vagrant instance, and start a vehicle:
73+
74+
.. code:: bash
75+
76+
vagrant ssh
77+
./sitl.sh
78+
79+
When prompted, enter your desired vehicle (e.g. "copter") to build/start SITL.
80+
Once complete, you will see a MAVProxy prompt displaying periodic vehicle-status updates:
81+
82+
.. code:: bash
83+
84+
Ready to FLY ublox Received 454 parameters
85+
fence breach
86+
APM: PreArm: RC not calibrated
87+
...
88+
89+
.. _disable-arming-checks:
90+
91+
#. Load a default set of parameters and disable the arming check:
92+
93+
.. code:: bash
94+
95+
STABILIZE>param load ../Tools/autotest/copter_params.parm
96+
STABILIZE>param set ARMING_CHECK 0
97+
98+
.. note::
99+
100+
SITL simulates (by default) a vehicle that may not pass the arming check. This change makes the simulated
101+
vehicle more forgiving, which allows the examples to arm and run.
102+
103+
You should never disable the arming check in a script or on a real vehicle.
104+
105+
106+
.. _viewing_uav_on_map:
107+
108+
Connecting an additional Ground Station
109+
=======================================
110+
111+
This section explains how you can connect multiple ground stations to a running SITL instance in addition to your DroneKit MAVProxy link.
112+
113+
To do this you first need to get SITL to output to an additional UDP port of your computer:
114+
115+
* Find the network IP address of your computer (On Windows you can get this by running *ipconfig* in the *Windows Command Prompt*).
116+
* In the *SITL Command Prompt*, add the IP address of the GCS computer (e.g. 192.168.2.10) and an unused port (e.g. 145502) as an output:
117+
118+
.. code:: bash
119+
120+
output add 192.168.2.10:14552
121+
122+
Then connect Mission Planner to this UDP port:
123+
124+
* `Download and install Mission Planner <http://ardupilot.com/downloads/?did=82>`_
125+
* Ensure the selection list at the top right of the Mission Planner screen says *UDP* and then select the **Connect** button next to it.
126+
When prompted, enter the port number (in this case 14552).
127+
128+
.. figure:: MissionPlanner_ConnectPort.png
129+
:width: 50 %
130+
131+
Mission Planner: Listen Port Dialog
132+
133+
After connecting, vehicle parameters will be loaded into *Mission Planner* and the vehicle is displayed on the map.
134+

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Contents:
1818
:maxdepth: 2
1919

2020
Introduction <about/index>
21-
quick_start
2221
guide/index
2322
examples/index
2423
contributing/index

0 commit comments

Comments
 (0)