-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
76 lines (56 loc) · 2.03 KB
/
config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# AUM SHREEGANESHAAY NAMAH|| AUM NAMAH SHIVAAYA||
# Global Variables and Constant Parameters like graphs are imported using this file
import json
from server2 import Server2 as Server
WPs, NBs, cars, sectors, carsSectors = None, None, None, None, None
b = 0.5 # granularity, metres (required for computing FP)
CLOCK_ACCURACY = 50 # microseconds (required for CZ detection)
T = 100 # milliseconds (periodic broadcast time period)
rho = 200 # milliseconds (worst end to end delay)
d_th = 0.63 # metres
S : Server = None # will initialize later
DEST_REACH_THRESHOLD = 0.7 # m
L = 2 # vehicle length (metres)
PID_ITERS = 10
kP_a, kI_a, kD_a = 5, 1, 0.1
kP_psi, kI_psi, kD_psi = 5, 1, 0.1
# Average computing times (Poisson distribution) in microseconds (us)
poi_avg = {
"boot_time" : 10000,
"compute_future_path_1" : 2000,
"compute_future_path_2" : 6000,
"find_conflict_zones" : 15000,
"construct_CDG" : 5000,
"deadlock_resolution" : 10000,
"motion_planner" : 5000,
"motion_controller" : 5000,
}
# modifications by Utkarsh Gupta
N_CARS = 6
WAIT_T = 1e6 # In Microseconds
CHANNEL_INFO, CHANNEL_PDG = 0, 1
# radius within which CAV's position is considered same as the closest waypoint's position
# affects whether or not CAV's position is used in FP computation)
FP_INCLUSION_THRESHOLD = 0 # metres
def importParentGraph(fname):
with open(fname) as f:
G = json.load(f)
global WPs, NBs, cars, sectors, carsSectors
WPs = G["waypoints"]
NBs = G["neighbours"]
cars = G["cars"]
sectors = G["sectors"]
carsSectors = G["carsSectors"]
def startServer():
global S, cars
S = Server(carNum = len(cars))
#### DESCRIPTION OF GRAPH ####
# WPs = array[{ "x": float(cm), "y": float(cm) }]
# NBs = array[ array[{ "idx" : int, "wt" : float (ms) }]]
# cars = array[{
# "id": int, "color": "#XYZ",
# "x": float(cm), "y": float(cm), "angle": float(rad), "speed" : float(m/s), "acc" : float(m/s2),
# "dest": int, "closest_wp": int
# }]
# sectors = array (20 x 20) [[ array[ int ] ]]
# carsSectors = array (20 x 20) [[ array[ int ] ]]