CARLA
LaneMarking.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017 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 
8 
9 #include "carla/Exception.h"
10 #include "carla/StringUtil.h"
12 
13 namespace carla {
14 namespace road {
15 namespace element {
16 
17  static LaneMarking::Type GetType(std::string str) {
19  if (str == "broken") {
21  } else if (str == "solid") {
23  } else if (str == "solid solid") {
25  } else if (str == "solid broken") {
27  } else if (str == "broken solid") {
29  } else if (str == "broken broken") {
31  } else if (str == "botts dots") {
33  } else if (str == "grass") {
35  } else if (str == "curb") {
37  } else if (str == "none") {
39  } else {
41  }
42  }
43 
44  static LaneMarking::Color GetColor(std::string str) {
46  if (str == "standard") {
48  } else if (str == "blue") {
50  } else if (str == "green") {
52  } else if (str == "red") {
54  } else if (str == "white") {
56  } else if (str == "yellow") {
58  } else {
60  }
61  }
62 
64  switch (lane_change) {
71  default:
73  }
74  }
75 
77  : type(GetType(info.GetType())),
78  color(GetColor(info.GetColor())),
79  lane_change(GetLaneChange(info.GetLaneChange())),
80  width(info.GetWidth()) {}
81 
82 } // namespace element
83 } // namespace road
84 } // namespace carla
Each lane within a road cross section can be provided with several road markentries.
static LaneMarking::LaneChange GetLaneChange(RoadInfoMarkRecord::LaneChange lane_change)
Definition: LaneMarking.cpp:63
LaneChange
Can be used as flags.
Definition: LaneMarking.h:49
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
LaneMarking(const RoadInfoMarkRecord &info)
Definition: LaneMarking.cpp:76
static void ToLower(WritableRangeT &str)
Definition: StringUtil.h:36
static LaneMarking::Type GetType(std::string str)
Definition: LaneMarking.cpp:17
static LaneMarking::Color GetColor(std::string str)
Definition: LaneMarking.cpp:44