-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbridge.py
82 lines (68 loc) · 2.31 KB
/
bridge.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
77
78
79
80
81
82
import carla
class Bridge(object):
@staticmethod
def lanelet2_marking(carla_marking, has_neighbour=False):
_type = carla_marking.type
if _type == carla.LaneMarkingType.NONE:
return {
'type': 'road_border'
}
elif _type == carla.LaneMarkingType.Other:
return {
'type': 'road_border'
}
elif _type == carla.LaneMarkingType.Broken:
return {
'type': 'line_thin',
'subtype': 'dashed',
"lane_change": 'yes' if has_neighbour else 'no'
}
elif _type == carla.LaneMarkingType.Solid:
return {
'type': 'line_thin',
'subtype': 'solid'
}
elif _type == carla.LaneMarkingType.SolidSolid:
return {
'type': 'line_thin',
'subtype': 'solid_solid'
}
elif _type == carla.LaneMarkingType.SolidBroken:
return {
'type': 'line_thin',
'subtype': 'solid_dashed',
'lane_change:right': 'no',
'lane_change:left': 'yes' if has_neighbour else 'no'
}
elif _type == carla.LaneMarkingType.BrokenSolid:
return {
'type': 'line_thin',
'subtype': 'dashed_solid',
'lane_change:right': 'yes' if has_neighbour else 'no',
'lane_change:left': 'no'
}
elif _type == carla.LaneMarkingType.BrokenBroken:
return {
'type': 'line_thin',
'subtype': 'dashed',
"lane_change": 'yes' if has_neighbour else 'no'
}
elif _type == carla.LaneMarkingType.BottsDots:
return {
'type': 'line_thin',
'subtype': 'dashed',
"lane_change": 'yes' if has_neighbour else 'no'
}
elif _type == carla.LaneMarkingType.Grass:
return {
'type': 'line_thin',
'subtype': 'solid',
}
elif _type == carla.LaneMarkingType.Curb:
return {
'type': 'line_thin',
'subtype': 'solid'
}
@staticmethod
def lanelet2_lane(carla_lane):
pass