CARLA
 
载入中...
搜索中...
未找到
LaneMarking.cpp
浏览该文件的文档.
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
13namespace carla {
14namespace road {
15namespace 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
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
static void ToLower(WritableRangeT &str)
Definition StringUtil.h:36
Each lane within a road cross section can be provided with several road markentries.
static LaneMarking::Type GetType(std::string str)
static LaneMarking::LaneChange GetLaneChange(RoadInfoMarkRecord::LaneChange lane_change)
static LaneMarking::Color GetColor(std::string str)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
LaneChange
Can be used as flags.
Definition LaneMarking.h:50
LaneMarking(const RoadInfoMarkRecord &info)