CARLA
 
载入中...
搜索中...
未找到
RoadInfoMarkRecord.h
浏览该文件的文档.
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
7#pragma once
8
11#include <string>
12#include <vector>
13#include <memory>
14
15namespace carla {
16namespace road {
17namespace element {
18
19 /// Each lane within a road cross section can be provided with several road
20 /// markentries. The road mark information defines the style of the line at
21 /// the lane’s outer border. For left lanes, this is the left border, for
22 /// right lanes the right one. The style of the line separating left and right
23 /// lanes is determined by the road mark entry for lane zero (i.e. the center
24 /// lane)
25 class RoadInfoMarkRecord final : public RoadInfo {
26 public:
27
28 /// Can be used as flags
29 enum class LaneChange : uint8_t {
30 None = 0x00, //00
31 Increase = 0x01, //01
32 Decrease = 0x02, //10
33 Both = 0x03 //11
34 };
35
37 double s,
38 int road_mark_id)
39 : RoadInfo(s),
40 _road_mark_id(road_mark_id),
41 _type(""),
42 _weight(""),
43 _color("white"),
44 _material("standard"),
45 _width(0.15),
47 _height(0.0),
48 _type_name(""),
49 _type_width(0.0) {}
50
52 double s,
53 int road_mark_id,
54 std::string type,
55 std::string weight,
56 std::string color,
57 std::string material,
58 double width,
59 LaneChange lane_change,
60 double height,
61 std::string type_name,
62 double type_width)
63 : RoadInfo(s),
64 _road_mark_id(road_mark_id),
65 _type(type),
66 _weight(weight),
67 _color(color),
68 _material(material),
69 _width(width),
70 _lane_change(lane_change),
71 _height(height),
72 _type_name(type_name),
73 _type_width(type_width) {}
74
76 v.Visit(*this);
77 }
78
79 /// Unique identifer for the road mark.
80 int GetRoadMarkId() const {
81 return _road_mark_id;
82 }
83
84 /// Type of the road mark.
85 const std::string &GetType() const {
86 return _type;
87 }
88
89 /// Weight of the road mark.
90 const std::string &GetWeight() const {
91 return _weight;
92 }
93
94 /// Color of the road mark.
95 const std::string &GetColor() const {
96 return _color;
97 }
98
99 /// Material of the road mark (identifiers to be defined, use "standard" for
100 /// the moment.
101 const std::string &GetMaterial() const {
102 return _material;
103 }
104
105 /// Width of the road mark –optional.
106 double GetWidth() const {
107 return _width;
108 }
109
110 /// Allow a lane change in the indicated direction taking into account that
111 /// lanes are numbered in ascending order from right to left. If the
112 /// attribute is missing, “both” is assumed to be valid.
114 return _lane_change;
115 }
116
117 /// Physical distance of top edge of road mark from reference plane of the
118 /// lane.
119 double GetHeight() const {
120 return _height;
121 }
122
123 /// Name of the road mark type if it has one.
124 const std::string &GetTypeName() const {
125 return _type_name;
126 }
127
128 /// Width of the road mark type if it has one.
129 double GetTypeWidth() const {
130 return _type_width;
131 }
132
133 std::vector<std::unique_ptr<RoadInfoMarkTypeLine>> &GetLines() {
134 return _lines;
135 }
136
137 private:
138
139 const int _road_mark_id;
140
141 const std::string _type;
142
143 const std::string _weight;
144
145 const std::string _color;
146
147 const std::string _material;
148
149 const double _width;
150
152
153 const double _height;
154
155 const std::string _type_name;
156
157 const double _type_width;
158
159 std::vector<std::unique_ptr<RoadInfoMarkTypeLine>> _lines;
160 };
161
162} // namespace element
163} // namespace road
164} // namespace carla
Each lane within a road cross section can be provided with several road markentries.
const std::string & GetWeight() const
Weight of the road mark.
const std::string & GetTypeName() const
Name of the road mark type if it has one.
RoadInfoMarkRecord(double s, int road_mark_id, std::string type, std::string weight, std::string color, std::string material, double width, LaneChange lane_change, double height, std::string type_name, double type_width)
int GetRoadMarkId() const
Unique identifer for the road mark.
std::vector< std::unique_ptr< RoadInfoMarkTypeLine > > & GetLines()
const std::string & GetType() const
Type of the road mark.
double GetTypeWidth() const
Width of the road mark type if it has one.
std::vector< std::unique_ptr< RoadInfoMarkTypeLine > > _lines
void AcceptVisitor(RoadInfoVisitor &v) final
const std::string & GetColor() const
Color of the road mark.
double GetHeight() const
Physical distance of top edge of road mark from reference plane of the lane.
LaneChange GetLaneChange() const
Allow a lane change in the indicated direction taking into account that lanes are numbered in ascendi...
const std::string & GetMaterial() const
Material of the road mark (identifiers to be defined, use "standard" for the moment.
double GetWidth() const
Width of the road mark –optional.
RoadInfoMarkRecord(double s, int road_mark_id)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133