CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
road
element
RoadInfoMarkRecord.h
Go to the documentation of this file.
1
// Copyright (c) 2026 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
9
#include "
carla/road/element/RoadInfo.h
"
10
#include "
carla/road/element/RoadInfoMarkTypeLine.h
"
11
#include <string>
12
#include <vector>
13
#include <memory>
14
15
namespace
carla
{
16
namespace
road
{
17
namespace
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
36
RoadInfoMarkRecord
(
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),
46
_lane_change
(
LaneChange
::None),
47
_height
(0.0),
48
_type_name
(
""
),
49
_type_width
(0.0),
50
_is_rht
(true) {}
51
52
RoadInfoMarkRecord
(
53
double
s,
54
int
road_mark_id,
55
std::string type,
56
std::string weight,
57
std::string color,
58
std::string material,
59
double
width,
60
LaneChange
lane_change,
61
double
height,
62
std::string type_name,
63
double
type_width,
64
bool
is_rht)
65
:
RoadInfo
(s),
66
_road_mark_id
(road_mark_id),
67
_type
(type),
68
_weight
(weight),
69
_color
(color),
70
_material
(material),
71
_width
(width),
72
_lane_change
(lane_change),
73
_height
(height),
74
_type_name
(type_name),
75
_type_width
(type_width),
76
_is_rht
(is_rht) {}
77
78
void
AcceptVisitor
(
RoadInfoVisitor
&v)
final
{
79
v.Visit(*
this
);
80
}
81
82
/// Unique identifer for the road mark.
83
int
GetRoadMarkId
()
const
{
84
return
_road_mark_id
;
85
}
86
87
/// Type of the road mark.
88
const
std::string &
GetType
()
const
{
89
return
_type
;
90
}
91
92
/// Weight of the road mark.
93
const
std::string &
GetWeight
()
const
{
94
return
_weight
;
95
}
96
97
/// Color of the road mark.
98
const
std::string &
GetColor
()
const
{
99
return
_color
;
100
}
101
102
/// Material of the road mark (identifiers to be defined, use "standard" for
103
/// the moment.
104
const
std::string &
GetMaterial
()
const
{
105
return
_material
;
106
}
107
108
/// Width of the road mark –optional.
109
double
GetWidth
()
const
{
110
return
_width
;
111
}
112
113
/// Allow a lane change in the indicated direction taking into account that
114
/// lanes are numbered in ascending order from right to left. If the
115
/// attribute is missing, “both” is assumed to be valid.
116
LaneChange
GetLaneChange
()
const
{
117
return
_lane_change
;
118
}
119
120
/// Physical distance of top edge of road mark from reference plane of the
121
/// lane.
122
double
GetHeight
()
const
{
123
return
_height
;
124
}
125
126
/// Name of the road mark type if it has one.
127
const
std::string &
GetTypeName
()
const
{
128
return
_type_name
;
129
}
130
131
/// Width of the road mark type if it has one.
132
double
GetTypeWidth
()
const
{
133
return
_type_width
;
134
}
135
136
bool
isRHT
()
const
{
137
return
_is_rht
;
138
}
139
140
std::vector<std::unique_ptr<RoadInfoMarkTypeLine>> &
GetLines
() {
141
return
_lines
;
142
}
143
144
private
:
145
146
const
int
_road_mark_id
;
147
148
const
std::string
_type
;
149
150
const
std::string
_weight
;
151
152
const
std::string
_color
;
153
154
const
std::string
_material
;
155
156
const
double
_width
;
157
158
const
LaneChange
_lane_change
;
159
160
const
double
_height
;
161
162
const
std::string
_type_name
;
163
164
const
double
_type_width
;
165
166
bool
_is_rht
;
167
168
std::vector<std::unique_ptr<RoadInfoMarkTypeLine>>
_lines
;
169
};
170
171
}
// namespace element
172
}
// namespace road
173
}
// namespace carla
RoadInfoMarkTypeLine.h
RoadInfo.h
carla::road::element::RoadInfoMarkRecord::_weight
const std::string _weight
Definition
RoadInfoMarkRecord.h:150
carla::road::element::RoadInfoMarkRecord::_is_rht
bool _is_rht
Definition
RoadInfoMarkRecord.h:166
carla::road::element::RoadInfoMarkRecord::isRHT
bool isRHT() const
Definition
RoadInfoMarkRecord.h:136
carla::road::element::RoadInfoMarkRecord::GetWeight
const std::string & GetWeight() const
Weight of the road mark.
Definition
RoadInfoMarkRecord.h:93
carla::road::element::RoadInfoMarkRecord::_width
const double _width
Definition
RoadInfoMarkRecord.h:156
carla::road::element::RoadInfoMarkRecord::GetTypeName
const std::string & GetTypeName() const
Name of the road mark type if it has one.
Definition
RoadInfoMarkRecord.h:127
carla::road::element::RoadInfoMarkRecord::_road_mark_id
const int _road_mark_id
Definition
RoadInfoMarkRecord.h:146
carla::road::element::RoadInfoMarkRecord::_lane_change
const LaneChange _lane_change
Definition
RoadInfoMarkRecord.h:158
carla::road::element::RoadInfoMarkRecord::GetRoadMarkId
int GetRoadMarkId() const
Unique identifer for the road mark.
Definition
RoadInfoMarkRecord.h:83
carla::road::element::RoadInfoMarkRecord::GetLines
std::vector< std::unique_ptr< RoadInfoMarkTypeLine > > & GetLines()
Definition
RoadInfoMarkRecord.h:140
carla::road::element::RoadInfoMarkRecord::GetType
const std::string & GetType() const
Type of the road mark.
Definition
RoadInfoMarkRecord.h:88
carla::road::element::RoadInfoMarkRecord::_type_width
const double _type_width
Definition
RoadInfoMarkRecord.h:164
carla::road::element::RoadInfoMarkRecord::GetTypeWidth
double GetTypeWidth() const
Width of the road mark type if it has one.
Definition
RoadInfoMarkRecord.h:132
carla::road::element::RoadInfoMarkRecord::_color
const std::string _color
Definition
RoadInfoMarkRecord.h:152
carla::road::element::RoadInfoMarkRecord::LaneChange
LaneChange
Can be used as flags.
Definition
RoadInfoMarkRecord.h:29
carla::road::element::RoadInfoMarkRecord::_lines
std::vector< std::unique_ptr< RoadInfoMarkTypeLine > > _lines
Definition
RoadInfoMarkRecord.h:168
carla::road::element::RoadInfoMarkRecord::AcceptVisitor
void AcceptVisitor(RoadInfoVisitor &v) final
Definition
RoadInfoMarkRecord.h:78
carla::road::element::RoadInfoMarkRecord::GetColor
const std::string & GetColor() const
Color of the road mark.
Definition
RoadInfoMarkRecord.h:98
carla::road::element::RoadInfoMarkRecord::_height
const double _height
Definition
RoadInfoMarkRecord.h:160
carla::road::element::RoadInfoMarkRecord::GetHeight
double GetHeight() const
Physical distance of top edge of road mark from reference plane of the lane.
Definition
RoadInfoMarkRecord.h:122
carla::road::element::RoadInfoMarkRecord::GetLaneChange
LaneChange GetLaneChange() const
Allow a lane change in the indicated direction taking into account that lanes are numbered in ascendi...
Definition
RoadInfoMarkRecord.h:116
carla::road::element::RoadInfoMarkRecord::_material
const std::string _material
Definition
RoadInfoMarkRecord.h:154
carla::road::element::RoadInfoMarkRecord::GetMaterial
const std::string & GetMaterial() const
Material of the road mark (identifiers to be defined, use "standard" for the moment.
Definition
RoadInfoMarkRecord.h:104
carla::road::element::RoadInfoMarkRecord::RoadInfoMarkRecord
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, bool is_rht)
Definition
RoadInfoMarkRecord.h:52
carla::road::element::RoadInfoMarkRecord::GetWidth
double GetWidth() const
Width of the road mark –optional.
Definition
RoadInfoMarkRecord.h:109
carla::road::element::RoadInfoMarkRecord::_type
const std::string _type
Definition
RoadInfoMarkRecord.h:148
carla::road::element::RoadInfoMarkRecord::_type_name
const std::string _type_name
Definition
RoadInfoMarkRecord.h:162
carla::road::element::RoadInfoMarkRecord::RoadInfoMarkRecord
RoadInfoMarkRecord(double s, int road_mark_id)
Definition
RoadInfoMarkRecord.h:36
carla::road::element::RoadInfoVisitor
Definition
RoadInfoVisitor.h:33
carla::road::element::RoadInfo::RoadInfo
RoadInfo(double distance=0.0)
Definition
RoadInfo.h:34
carla::road::element
Definition
SignComponent.h:26
carla::road
Definition
SignComponent.h:23
carla::road::Both
@ Both
Definition
Signal.h:24
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
Generated by
1.18.0