-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (33 loc) · 1.22 KB
/
Copy pathmain.py
File metadata and controls
49 lines (33 loc) · 1.22 KB
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
49
# Copyright (C) 2021 Anatole Hernot (github.com/ahernot), Mines Paris (PSL Research University). All rights reserved.
import time
from camera import Camera, CameraPlaceholder
from controller import ODOP
from composition import Composition
from functions import type_input
from preferences import *
if __name__ == '__main__':
# Initialise camera
camera = Camera()
while not camera.ready():
time.sleep(0.1)
camera.update_status()
# Initialise ODOP
odop = ODOP()
while not odop.ready():
time.sleep(0.1)
# Calibrate ODOP
odop.calibrate()
while True:
vertical_shots_nb = type_input('Enter the number of vertical shots\n> ', int)
horizontal_shots_nb = type_input('Enter the number of horizontal shots\n> ', int)
# Create composition
composition = Composition (
odop=odop,
camera=camera,
vertical_shots_nb=vertical_shots_nb,
horizontal_shots_nb=horizontal_shots_nb
)
input(f'\nComposition initialised. Press any key to begin run.\n{RUN_MESSAGE}')
# Run composer
success, msg = composition.run()
if not success: raise InterruptedError(f'run failure - {msg}')