CARLA
 
载入中...
搜索中...
未找到
SignalType.cpp
浏览该文件的文档.
1// Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy; see <https://opensource.org/licenses/MIT>.
6
7#include "SignalType.h"
8
9#include <vector>
10#include <algorithm>
11
12namespace carla {
13namespace road {
14
15 const std::string SignalType::Danger() {
16 return "101";
17 } // danger types from 101 to 151
18 const std::string SignalType::LanesMerging() {
19 return "121";
20 } // = "121";
21 const std::string SignalType::CautionPedestrian() {
22 return "133";
23 } // = "133";
24 const std::string SignalType::CautionBicycle() {
25 return "138";
26 } // = "138";
27 const std::string SignalType::LevelCrossing() {
28 return "150";
29 } // = "150";
30 const std::string SignalType::YieldSign() {
31 return "205";
32 } // = "205";
33 const std::string SignalType::StopSign() {
34 return "206";
35 } // = "206";
37 return "209";
38 } // = "209"; // Left, right or forward
40 return "211";
41 } // = "211";
43 return "214";
44 } // = "214"; // Forward-left, forward-right, left-right
45 const std::string SignalType::Roundabout() {
46 return "215";
47 } // = "215";
48 const std::string SignalType::PassRightLeft() {
49 return "222";
50 } // = "222";
51 const std::string SignalType::AccessForbidden() {
52 return "250";
53 } // = "250";
55 return "251";
56 } // = "251";
58 return "253";
59 } // = "253";
61 return "254";
62 } // = "254";
64 return "263";
65 } // = "263";
67 return "264";
68 } // = "264";
70 return "265";
71 } // = "265";
73 return "267";
74 } // = "267";
75 const std::string SignalType::ForbiddenUTurn() {
76 return "272";
77 } // = "272";
78 const std::string SignalType::MaximumSpeed() {
79 return "274";
80 } // = "274";
82 return "276";
83 } // = "276";
85 return "277";
86 } // = "277";
87 const std::string SignalType::AbsoluteNoStop() {
88 return "283";
89 } // = "283";
90 const std::string SignalType::RestrictedStop() {
91 return "286";
92 } // = "286";
94 return "301";
95 } // = "301";
96 const std::string SignalType::PriorityWay() {
97 return "306";
98 } // = "306";
99 const std::string SignalType::PriorityWayEnd() {
100 return "307";
101 } // = "307";
102 const std::string SignalType::CityBegin() {
103 return "310";
104 } // = "310";
105 const std::string SignalType::CityEnd() {
106 return "311";
107 } // = "311";
108 const std::string SignalType::Highway() {
109 return "330";
110 } // = "330";
111 const std::string SignalType::DeadEnd() {
112 return "357";
113 } // = "357";
114 const std::string SignalType::RecomendedSpeed() {
115 return "380";
116 } // = "380";
117 const std::string SignalType::RecomendedSpeedEnd() {
118 return "381";
119 } // = "381";
120
121 bool SignalType::IsTrafficLight(const std::string &type) {
122 // Types corresponding to traffic lights
123 const std::vector<std::string> traffic_light_types =
124 {"1000001", "1000002", "1000009", "1000010", "1000011",
125 "1000007", "1000014", "1000015", "1000016", "1000017",
126 "1000018", "1000019", "1000013", "1000020", "1000008",
127 "1000012", "F", "W", "A"};
128
129 auto it = std::find(
130 traffic_light_types.begin(), traffic_light_types.end(), type);
131 if (it != traffic_light_types.end()){
132 return true;
133 } else {
134 return false;
135 }
136 }
137
138}
139}
static const std::string CautionBicycle()
static const std::string AccessForbiddenWrongDirection()
static const std::string AccessForbiddenBicycle()
static const std::string RecomendedSpeed()
static const std::string AbsoluteNoStop()
static const std::string MandatoryTurnDirection()
static const std::string DeadEnd()
static const std::string AccessForbidden()
static const std::string RestrictedStop()
static const std::string LevelCrossing()
static const std::string CityBegin()
static const std::string ForbiddenUTurn()
static const std::string ForbiddenOvertakingTrucks()
static const std::string YieldSign()
static const std::string Danger()
static const std::string RecomendedSpeedEnd()
static const std::string AccessForbiddenMotorvehicles()
static const std::string CautionPedestrian()
static const std::string Highway()
static const std::string AccessForbiddenHeight()
static const std::string Roundabout()
static const std::string PassRightLeft()
static const std::string HasWayNextIntersection()
static bool IsTrafficLight(const std::string &type)
static const std::string CityEnd()
static const std::string ForbiddenOvertakingMotorvehicles()
static const std::string LanesMerging()
static const std::string AccessForbiddenWeight()
static const std::string MandatoryLeftRightDirection()
static const std::string MaximumSpeed()
static const std::string PriorityWayEnd()
static const std::string AccessForbiddenTrucks()
static const std::string PriorityWay()
static const std::string TwoChoiceTurnDirection()
static const std::string StopSign()
static const std::string AccessForbiddenWidth()
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133