Skip to content

Commit 4cb6d3f

Browse files
committed
Merge pull request #45 from diydrones/vagrant
Vagrant for cross-platform doc builds
2 parents afa6ea8 + fd22a7c commit 4cb6d3f

File tree

14 files changed

+84
-49
lines changed

14 files changed

+84
-49
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
droneapi.egg-info
44
dist
55
build
6+
.vagrant
67
*~
7-

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This package contains the python language bindings for the drone API and the ass
88

99
## Users wanted!
1010

11-
We'd love your [feedback and suggestions](https://github.com/diydrones/dronekit-python/issues) about this API and are eager to evolve it to meet your needs.
11+
We'd love your [feedback and suggestions](https://github.com/diydrones/dronekit-python/issues) about this API and are eager to evolve it to meet your needs.
1212

1313
For documentation on how to use this API please see:
1414

@@ -27,7 +27,6 @@ For documentation on how to use this API please see:
2727
* Advanced ['drone_delivery'](example/drone_delivery/)
2828
* Advanced ['follow-me'](example/follow_me/)
2929

30-
3130
[Stack Overflow](http://stackoverflow.com/questions/tagged/dronekit-python) is the best place to ask for *technical support* on how to use the API.
3231

33-
Copyright 2014 3D Robotics, Inc. - Licensed under the Apache 2.0 License.
32+
Copyright 2014 3D Robotics, Inc. - Licensed under the Apache 2.0 License.

Vagrantfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
Vagrant.configure(2) do |config|
5+
config.vm.box = "ubuntu/trusty64"
6+
7+
config.vm.provision "shell", inline: <<-SHELL
8+
apt-get -y update
9+
echo "[DroneKit]: Installing build essentials"
10+
apt-get -y install build-essential
11+
echo "[DroneKit]: Installing Python Devel"
12+
apt-get -y install python-dev
13+
echo "[DroneKit]: Installing pip ..."
14+
apt-get -y install python-pip
15+
easy_install -U pip
16+
echo "[DroneKit]: Installing Sphinx ... "
17+
pip install sphinx
18+
cd /vagrant
19+
echo "[DroneKit]: Installing DroneKit-Python requirements.txt ... "
20+
pip install -r requirements.txt
21+
echo "[DroneKit]: Building docs "
22+
cd docs/
23+
make html
24+
SHELL
25+
end

docs/automodule.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
=============================
12
DroneKit-Python API Reference
23
=============================
34

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# If extensions (or modules to document with autodoc) are in another directory,
1818
# add these directories to sys.path here. If the directory is relative to the
1919
# documentation root, use os.path.abspath to make it absolute, like shown here.
20-
sys.path.insert(0, os.path.abspath('../droneapi'))
20+
sys.path.append(os.path.abspath('..'))
2121

2222
# -- General configuration -----------------------------------------------------
2323

docs/example_1.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
========================
12
First Demo: Simple Go To
23
========================
34

45
This little demonstration just tells the vehicle to fly to a couple of different locations in the world. You can edit the code to pick a latitude and longitude close to your position.
56

67
Running the example
7-
-------------------
8+
===================
89

910
Once Mavproxy is running and the API is loaded, you can run this small example by typing: ``api start simple_goto.py``
1011

@@ -20,7 +21,7 @@ It will tell your vehicle to start flying to a particular latitude and longitude
2021

2122

2223
How does it work?
23-
-----------------
24+
=================
2425

2526
The key code in this demo is the following:
2627

docs/example_2.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
===========================
12
Second Demo: Drone Delivery
23
===========================
34

@@ -10,7 +11,7 @@ New functionality demonstrated by this example includes:
1011

1112

1213
Starting the demo
13-
------------------
14+
=================
1415

1516
The demonstration is started similar to the previous tutorials. You should see output that looks like the following:
1617

@@ -34,7 +35,7 @@ The demonstration is started similar to the previous tutorials. You should see
3435
GPS lock at 0 meters
3536

3637
Screenshots
37-
-----------
38+
===========
3839

3940
You should be able to reach your new webserver at http://localhost:8080. It will look like the following:
4041

@@ -46,10 +47,10 @@ You should be able to reach your new webserver at http://localhost:8080. It will
4647

4748

4849
Looking at the code
49-
-------------------
50+
===================
5051

5152
Using attribute observers
52-
~~~~~~~~~~~~~~~~~~~~~~~~~
53+
-------------------------
5354

5455
All attributes in DroneKit can have observers - this is the primary mechanism you should use to be notified of changes in vehicle state. For instance, `drone_delivery.py <https://github.com/diydrones/droneapi-python/blob/master/example/drone_delivery/drone_delivery.py>`_ calls:
5556

@@ -71,7 +72,7 @@ All attributes in DroneKit can have observers - this is the primary mechanism yo
7172
This results in DroneKit calling our ``location_callback`` method any time the location attribute gets changed.
7273

7374
Starting CherryPy from a DroneKit application
74-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
---------------------------------------------
7576

7677
We start running a web server by calling ``cherrypy.engine.start()``.
7778

docs/example_3.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
=========================
12
Third Demo: Flight Replay
23
=========================
34

45
This is an interesting demo that uses our web API to query raw flight data from a particular flight.
56

67

78
Starting the demo
8-
-----------------
9+
=================
910

1011
In this case, we pick some public flight from `Droneshare <http://www.droneshare.com/>`_:
1112

@@ -37,10 +38,10 @@ One possible use of some variant of this tool to replay your old flights at your
3738

3839

3940
How it works
40-
------------
41+
============
4142

4243
Getting the points
43-
~~~~~~~~~~~~~~~~~~
44+
------------------
4445

4546
The following simple function asks for the droneshare flight data:
4647

@@ -60,7 +61,7 @@ Some comments:
6061

6162

6263
Setting the new waypoints
63-
-------------------------
64+
=========================
6465

6566
We generate up to 100 wpts for the vehicle with the following code:
6667

docs/example_4.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
======================
12
Fourth Demo: Follow Me
23
======================
34

docs/first_app.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
====================
12
Running the Examples
2-
===============
3+
====================
4+
35

46
With your drone connected via SITL or USB, you can verify the DroneKit installation by running the example apps that come with the source of DroneKit Python.
57

@@ -16,36 +18,36 @@ Let's run a small example app to verify our connection with the drone:
1618

1719

1820
Starting MAVProxy
19-
------------------
21+
=================
2022

2123
When developing new DroneAPI python code the easiest approach is to run it inside of MAVProxy.
2224

2325
So launch MAVProxy with the correct options for talking to your vehicle:
2426

2527
Linux computer connected to the vehicle via USB
26-
~~~~~~~~~~~~~~~~~~
28+
-----------------------------------------------
2729

2830
::
2931

3032
mavproxy.py --master=/dev/ttyUSB0
3133

3234
SITL Linux connected to the vehicle via UDP
33-
~~~~~~~~~~~~~~~~~~
35+
-------------------------------------------
3436

3537
::
3638

3739
mavproxy.py
3840

3941
OSX computer connected to the vehicle via USB
40-
~~~~~~~~~~~~~~~~~~
42+
---------------------------------------------
4143

4244
::
4345

4446
mavproxy.py --master=/dev/cu.usbmodem1
4547

4648

4749
Windows computer connected to the vehicle via USB
48-
~~~~~~~~~~~~~~~~~~
50+
-------------------------------------------------
4951

5052
::
5153

@@ -55,7 +57,7 @@ Windows computer connected to the vehicle via USB
5557
For other connection options see the `MAVProxy documentation <http://tridge.github.io/MAVProxy/>`_.
5658

5759
Loading DroneKit
58-
------------------
60+
================
5961

6062
The API includes a mavproxy module to allow you to load (and reload) your custom application into mavproxy.
6163

@@ -74,7 +76,7 @@ We recommend adding this line to the mavproxy startup script in ~/.mavinit.scr.
7476
echo "module load droneapi.module.api" >> ~/.mavinit.scr
7577

7678
Running the example
77-
------------------
79+
===================
7880

7981
The first example we will run is a very small application that just reads some vehicle state and then changes the vehicle mode to AUTO (to start following prestored waypoints).
8082

0 commit comments

Comments
 (0)