Skip to content

Commit 6439d9c

Browse files
committed
Merge branch 'master' into master
2 parents 5baf480 + b91bf76 commit 6439d9c

File tree

6 files changed

+52
-24
lines changed

6 files changed

+52
-24
lines changed

Vagrantfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
Vagrant.configure(2) do |config|
55
config.vm.box = "ubuntu/trusty64"
6+
config.vm.network "private_network", type: "dhcp"
67

78
config.vm.provision "shell", inline: <<-SHELL
89
apt-get -y update
@@ -13,6 +14,12 @@ Vagrant.configure(2) do |config|
1314
echo "[DroneKit]: Installing pip ..."
1415
apt-get -y install python-pip
1516
easy_install -U pip
17+
echo "[DroneKit]: Installing python-cherrypy3 ..."
18+
apt-get -y install python-cherrypy3
19+
echo "[DroneKit]: Installing python-matplotlib ..."
20+
apt-get -y install python-matplotlib
21+
echo "[DroneKit]: Installing python-gps ..."
22+
apt-get -y install python-gps
1623
echo "[DroneKit]: Installing Sphinx ... "
1724
pip install sphinx
1825
cd /vagrant

docs/develop/companion-computers.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ The following computing platforms are known to work with DroneKit, and are suppo
1515
RaspberryPi
1616
-----------
1717

18-
* `Communicating with Raspberry Pi via MAVLink <http://dev.ardupilot.com/wiki/companion-computers/raspberry-pi-via-mavlink/>`_
19-
* `Making a Mavlink WiFi bridge using the Raspberry Pi <http://dev.ardupilot.com/wiki/companion-computers/raspberry-pi-via-mavlink/making-a-mavlink-wifi-bridge-using-the-raspberry-pi/>`_
18+
* `Communicating with Raspberry Pi via MAVLink <http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html>`_
19+
* `Making a Mavlink WiFi bridge using the Raspberry Pi <http://ardupilot.org/dev/docs/making-a-mavlink-wifi-bridge-using-the-raspberry-pi.html>`_
2020

2121
Intel Edison
2222
------------
2323

24-
* `Edison for drones <http://dev.ardupilot.com/wiki/companion-computers/edison-for-drones/>`_
24+
* `Edison for drones <http://ardupilot.org/dev/docs/edison-for-drones.html>`_
2525

2626
BeagleBoneBlack
2727
---------------
2828

29-
* `BeaglePilot <http://dev.ardupilot.com/wiki/companion-computers/beaglepilot/>`_
29+
* `BeaglePilot <http://ardupilot.org/dev/docs/beaglepilot.html>`_
3030

3131
Odroid
3232
------
33-
* `Communicating with ODroid via MAVLink <http://dev.ardupilot.com/wiki/companion-computers/odroid-via-mavlink/>`_
34-
* `ODroid Wifi Access Point for sharing files via Samba <http://dev.ardupilot.com/wiki/companion-computers/odroid-via-mavlink/odroid-wifi-access-point-for-sharing-files-via-samba/>`_
33+
* `Communicating with ODroid via MAVLink <http://ardupilot.org/dev/docs/odroid-via-mavlink.html>`_
34+
* `ODroid Wifi Access Point for sharing files via Samba <http://ardupilot.org/dev/docs/odroid-wifi-access-point-for-sharing-files-via-samba.html>`_
3535

docs/guide/quick_start.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@ Installation
1313
============
1414

1515
DroneKit-Python and the *dronekit-sitl simulator* are installed
16-
from **pip** on all platforms:
16+
from **pip** on all platforms.
1717

18-
.. code-block:: bash
19-
20-
pip install dronekit
21-
pip install dronekit-sitl
22-
23-
Mac and Linux require you prefix the command with ``sudo``.
2418
On Linux you will first need to install **pip** and **python-dev**:
2519

2620
.. code-block:: bash
2721
2822
sudo apt-get install python-pip python-dev
2923
3024
25+
**pip** is then used to install *dronekit* and *dronekit-sitl*.
26+
Mac and Linux may require you to prefix these commands with ``sudo``:
27+
28+
.. code-block:: bash
29+
30+
pip install dronekit
31+
pip install dronekit-sitl
32+
3133
See :doc:`../develop/installation` and `dronekit-sitl <https://github.com/dronekit/dronekit-sitl#dronekit-sitl>`_
3234
for more detailed installation instructions.
3335

dronekit/test/sitl/test_channels.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def channels_callback(vehicle, name, channels):
151151
i = 5
152152
while not result['success'] and i > 0:
153153
time.sleep(.1)
154+
i -= 1
154155
assert result['success'], 'channels callback should be invoked.'
155156

156157
vehicle.close()

examples/drone_delivery/drone_delivery.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def _run_server(self):
109109
'log.screen': None
110110
})
111111

112-
print 'http://localhost:8080/'
112+
print('''Server is bound on all addresses, port 8080
113+
You may connect to it using your web broser using a URL looking like this:
114+
http://localhost:8080/
115+
''')
113116
cherrypy.engine.start()
114117

115118
def change_mode(self, mode):

examples/gcs/microgcs.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,26 @@
1212
#Set up option parsing to get connection string
1313
import argparse
1414
parser = argparse.ArgumentParser(description='Tracks GPS position of your computer (Linux only). Connects to SITL on local PC by default.')
15-
parser.add_argument('--connect', default='127.0.0.1:14550',
16-
help="vehicle connection target. Default '127.0.0.1:14550'")
15+
parser.add_argument('--connect',
16+
help="vehicle connection target.")
1717
args = parser.parse_args()
1818

19+
connection_string = args.connect
20+
sitl = None
21+
22+
#Start SITL if no connection string specified
23+
if not args.connect:
24+
print "Starting copter simulator (SITL)"
25+
from dronekit_sitl import SITL
26+
sitl = SITL()
27+
sitl.download('copter', '3.3', verbose=True)
28+
sitl_args = ['-I0', '--model', 'quad', '--home=-35.363261,149.165230,584,353']
29+
sitl.launch(sitl_args, await_ready=True, restart=True)
30+
connection_string = 'tcp:127.0.0.1:5760'
1931

2032
# Connect to the Vehicle
21-
print 'Connecting to vehicle on: %s' % args.connect
22-
vehicle = connect(args.connect, wait_ready=True)
33+
print 'Connecting to vehicle on: %s' % connection_string
34+
vehicle = connect(connection_string, wait_ready=True)
2335

2436
def setMode(mode):
2537
# Now change the vehicle into auto mode
@@ -31,8 +43,7 @@ def updateGUI(label, value):
3143

3244
def addObserverAndInit(name, cb):
3345
"""We go ahead and call our observer once at startup to get an initial value"""
34-
cb(name)
35-
vehicle.add_attribute_observer(name, cb)
46+
vehicle.add_attribute_listener(name, cb)
3647

3748
root = Tk()
3849
root.wm_title("microGCS - the worlds crummiest GCS")
@@ -46,11 +57,15 @@ def addObserverAndInit(name, cb):
4657
modeLabel = Label(frame, text = "mode")
4758
modeLabel.pack()
4859

49-
addObserverAndInit('attitude', lambda attr: updateGUI(attitudeLabel, vehicle.attitude))
50-
addObserverAndInit('location', lambda attr: updateGUI(locationLabel, vehicle.location))
51-
addObserverAndInit('mode', lambda attr: updateGUI(modeLabel, vehicle.mode))
60+
addObserverAndInit('attitude', lambda vehicle, name, attitude: updateGUI(attitudeLabel, vehicle.attitude))
61+
addObserverAndInit('location', lambda vehicle, name, location: updateGUI(locationLabel, str(location.global_frame)))
62+
addObserverAndInit('mode', lambda vehicle,name,mode: updateGUI(modeLabel, mode))
5263

5364
Button(frame, text = "Auto", command = lambda : setMode("AUTO")).pack()
5465
Button(frame, text = "RTL", command = lambda : setMode("RTL")).pack()
5566

56-
root.mainloop()
67+
root.mainloop()
68+
69+
# Shut down simulator if it was started.
70+
if sitl is not None:
71+
sitl.stop()

0 commit comments

Comments
 (0)