forked from OpenSolo/shotmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·27 lines (20 loc) · 690 Bytes
/
main.py
File metadata and controls
executable file
·27 lines (20 loc) · 690 Bytes
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
#!/usr/bin/env python
# Main entry point for shot manager
import os
from os import sys, path
sys.path.append(os.path.realpath(''))
import shotManager
from dronekit import connect
from dronekit_solo import SoloVehicle
from dronekit.mavlink import MAVConnection
# First get an instance of the API endpoint
vehicle = connect(sys.argv[1], wait_ready=False, vehicle_class=SoloVehicle, source_system=255, use_native=True, heartbeat_timeout=-1)
if 'SOLOLINK_SANDBOX' in os.environ:
from sim import rc_ipc_shim
rc_ipc_shim.pixrc_start()
out = MAVConnection(sys.argv[2], source_system=254)
vehicle._handler.pipe(out)
out.start()
mgr = shotManager.ShotManager()
mgr.Start(vehicle)
mgr.Run()