Commit 2932a150 authored by Marlene Böhmer's avatar Marlene Böhmer

target delay parameter and ntp

parent 46078a3d
Subproject commit b3ef5eb222f83f71a5d0a6e7ab29965783e51523
Subproject commit fee47c6a26e7e9bb343ec30400b7d53ae18de43e
include:
- drone.install-ntp
- prrt.python
- drone.python-libs
- drone.crazyflie-lib
......
ntp:
pkg.installed
ntpdate:
pkg.installed
......@@ -2,11 +2,9 @@
import sys
import threading
import signal
from cflib.crtp.serialdriver import SerialDriver
from cflib.crtp.prrtdriver import PrrtDriver
import cflib.crtp as crtp
from cflib.crtp.crtpstack import CRTPPacket, CRTPPort
......@@ -45,15 +43,19 @@ class BackwardBridge(threading.Thread):
class Bridge:
def __init__(self, crazyflie_driver, crazyflie_uri, client_driver, client_uri):
def __init__(self, crazyflie_uri, client_uri):
print('Initializing Bridge ...')
self._crazyflie_connection = crazyflie_driver
self.crazyflie_uri = crazyflie_uri
self._client_connection = client_driver
self.client_uri = client_uri
self._crazyflie_connection.connect(crazyflie_uri, None, None)
self._client_connection.connect(client_uri, None, None)
crtp.init_drivers(enable_debug_driver=False)
self._crazyflie_connection = crtp.get_link_driver(self.crazyflie_uri, None, None)
if not self._crazyflie_connection:
raise Exception('No diver found for Crazyflie URI ' + self.crazyflie_uri)
self._client_connection = crtp.get_link_driver(self.client_uri, None, None)
if not self._client_connection:
raise Exception('No diver found for Client URI ' + self.client_uri)
self.forward_thread = None
self.backward_thread = None
......@@ -95,9 +97,9 @@ if __name__ == '__main__':
serial_uri = 'serial://pi'
prrt_uri = sys.argv[1]
bridge = Bridge(SerialDriver(), serial_uri, PrrtDriver(), prrt_uri)
bridge = Bridge(serial_uri, prrt_uri)
bridge.check_for_crazyflie_connection()
bridge.check_for_crazyflie_connection() # optional
bridge.start()
print('\nSetup finished.\nUse "Ctrl+C" to stop.\n')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment