forked from DaemonLab/Drone-Swarm-InterIIT-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.py
45 lines (22 loc) · 934 Bytes
/
master.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
import matplotlib
import multiprocessing
from multiprocessing import Pipe
import time
from pypluto.Control.task3_toge import PID_main
from pypluto.Camera.marker import marker_publisher
# builds necessary connections of drone(1,2,...) & the camera file
def build_conn():
#creates connection btw marker1 file and drone1
connCam,connDrone1 = Pipe(duplex = True)
p1 = multiprocessing.Process(target=marker_publisher, args=( [connCam]))
p2 = multiprocessing.Process(target=PID_main, args=([connDrone1]))
#first detect pose , then takeoff
p1.start()
print('\n-------Starting process Camera-------')
time.sleep(2)
print("\n-----Starting Drone1--------")
p2.start()
p1.join()
p2.join()
if __name__ == "__main__":
build_conn() #starts camera file and drone1 file , also builds connection btw the two