-
Notifications
You must be signed in to change notification settings - Fork 4
/
actions.py
58 lines (56 loc) · 1.62 KB
/
actions.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
action_sets = [
[
[0.0, 0.3, 0.0], # throttle
[0.0, 0.1, 0.0], # throttle
[0.0, 0.0, 0.5], # break
[0.0, 0.0, 0.2], # break
[-1.0, 0.0, 0.05], # left
[-1.0, 0.0, 0.05], # left
[-1.0, 0.0, 0.05], # left
[1.0, 0.0, 0.05], # right
[1.0, 0.0, 0.05], # right
[1.0, 0.0, 0.05], # right
],
[
[0.0, 0.8, 0.0], # throttle
[0.0, 0.0, 0.6], # break
[-0.8, 0.0, 0.0], # left
[-0.5, 0.0, 0.0], # left
[-0.2, 0.0, 0.0], # left
[0.8, 0.0, 0.0], # right
[0.5, 0.0, 0.0], # right
[0.2, 0.0, 0.0], # right
],
[
[0.0, 0.8, 0.0], # throttle
[0.0, 0.0, 0.6], # break
[-0.8, 0.0, 0.0], # left
[0.8, 0.0, 0.0], # right
],
[
[0.0, 0.0, 0.0], # no action
[0.0, 0.8, 0.0], # throttle
[0.0, 0.0, 0.6], # break
[-0.8, 0.0, 0.0], # left
[0.8, 0.0, 0.0], # right
],
[
[0.0, 0.3, 0.0], # throttle
[0.0, 0.1, 0.0], # throttle
[0.0, 0.0, 0.0], # throttle
[0.0, 0.0, 0.7], # break
[0.0, 0.0, 0.5], # break
[0.0, 0.0, 0.2], # break
[-1.0, 0.0, 0.05], # left
[-0.5, 0.0, 0.05], # left
[-0.2, 0.0, 0.05], # left
[1.0, 0.0, 0.05], # right
[0.5, 0.0, 0.05], # right
[0.2, 0.0, 0.05], # right
]
]
def get_action(set_num):
if set_num >= len(action_sets):
assert "Wrong available set num. It should go from 0 to {}".format(len(action_sets) - 1)
return None
return action_sets[set_num]