-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDroneController.py
48 lines (37 loc) · 1.7 KB
/
DroneController.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import threading
from IntelligenceHandler.IntelligenceHandler import IntelligenceHandler
def DroneController(drone):
class DroneController(drone):
def __init__(self, workerAddress, interfaceAddress,
manualControlOnly):
#The web address that handles the worker objects,
#machines handling object-detection, depth-perception,
#and LLM inference.
self.workerAddress = workerAddress
#The web address which the drone and human teammates connect to.
self.interfaceAddress = interfaceAddress
self.manualControlOnly = manualControlOnly
self.movementThread = threading.Thread(target=self.createMovementHandler)
self.intelThread = threading.Thread(target=self.createIntelligenceHandler)
#instantiate parent object, the specific drone be utilized
super().__init__(self.interfaceAddress)
self.intelligence = IntelligenceHandler(self,
self.workerAddress)
self.startDrone()
# Controls system/drone action/movement
def createMovementHandler(self) :
self.movementController.run()
def completedAction(self):
self.movementController.completedAction()
#This handles the worker pool connections:
#the drone imagery, llm response, etc.
#Additionally, houses all of the data asscoiated
#with the mentioned items. It is integral to
#to the system.
def createIntelligenceHandler(self) :
self.intelligence.run()
def startDrone(self):
self.movementThread.start()
self.intelThread.start()
self.movementThread.join()
return DroneController