-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_loader.py
25 lines (22 loc) · 1.2 KB
/
config_loader.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
import configparser
# deprecated
def get_configurations():
config = configparser.ConfigParser()
config.read('config.ini')
configurations = {
'fx': float(config['CameraParameters']['fx']),
'fy': float(config['CameraParameters']['fy']),
'k1': float(config['CameraParameters']['k1']),
'k2': float(config['CameraParameters']['k2']),
'e2e_height_rr': int(config['RingProperties']['e2e_height_rr']),
'e2e_height_yl': int(config['RingProperties']['e2e_height_yr']),
'diameter_red_cms': int(config['RingProperties']['diameter_red_cms']),
'diameter_yellow_cms': int(config['RingProperties']['diameter_yellow_cms']),
'yellow_optimum_hover_ht': int(config['RingProperties']['yellow_optimum_hover_ht']),
'red_optimum_hover_ht': int(config['RingProperties']['red_optimum_hover_ht']),
'speed': int(config['DroneProperties']['speed']),
'max_distance_btw_rings': int(config['RingProperties']['max_distance_btw_rings']),
'hover_up_down_threshold': int(config['DroneProperties']['hover_up_down_threshold']),
'right_left_threshold': int(config['DroneProperties']['right_left_threshold']),
}
return configurations