Skip to content

Commit

Permalink
Added capability to run without dronekit installed
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostop14 committed Jun 29, 2018
1 parent d194831 commit acbb046
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sparrowwifiagent.py
Expand Up @@ -35,7 +35,12 @@

from wirelessengine import WirelessEngine
from sparrowgps import GPSEngine, GPSStatus
from sparrowdrone import SparrowDroneMavlink
try:
from sparrowdrone import SparrowDroneMavlink
hasDroneKit = True
except:
hasDroneKit = False

from sparrowrpi import SparrowRPi
from sparrowbluetooth import SparrowBluetooth, BluetoothDevice
from sparrowhackrf import SparrowHackrf
Expand Down Expand Up @@ -2633,7 +2638,7 @@ def checkForBluetooth():

buildAllowedIPs(allowedIPstr)

if len(runningcfg.mavlinkGPS) > 0:
if len(runningcfg.mavlinkGPS) > 0 and hasDroneKit:
vehicle = SparrowDroneMavlink()

print('Connecting to ' + runningcfg.mavlinkGPS)
Expand Down Expand Up @@ -2721,7 +2726,7 @@ def checkForBluetooth():

stopRecord()

if useMavlink and vehicle:
if hasDroneKit and useMavlink and vehicle:
vehicle.close()

stopAnnounceThread()
Expand Down

0 comments on commit acbb046

Please sign in to comment.