CARLA
 
载入中...
搜索中...
未找到
RoadInfoSignal.h
浏览该文件的文档.
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#pragma once
8
9#include "carla/road/Signal.h"
11
12namespace carla {
13namespace road {
14namespace element {
15
16 class RoadInfoSignal final : public RoadInfo {
17 public:
18
20 SignId signal_id,
21 Signal* signal,
22 RoadId road_id,
23 double s,
24 double t,
25 std::string orientation)
26 : RoadInfo(s),
27 _signal_id(signal_id),
28 _signal(signal),
29 _road_id(road_id),
30 _s(s),
31 _t(t),
32 _orientation(orientation) {}
33
35 SignId signal_id,
36 RoadId road_id,
37 double s,
38 double t,
39 std::string orientation)
40 : RoadInfo(s),
41 _signal_id(signal_id),
42 _road_id(road_id),
43 _s(s),
44 _t(t),
45 _orientation(orientation) {}
46
48 v.Visit(*this);
49 }
50
52 return _signal_id;
53 }
54
55 const Signal* GetSignal() const {
56 return _signal;
57 }
58
59 RoadId GetRoadId() const {
60 return _road_id;
61 }
62
63 bool IsDynamic() const {
64 return _signal->GetDynamic();
65 }
66
67 double GetS() const {
68 return _s;
69 }
70
71 double GetT() const {
72 return _t;
73 }
74
76 if(_orientation == "+") {
78 } else if(_orientation == "-") {
80 } else {
82 }
83 }
84
85 const std::vector<LaneValidity> &GetValidities() const {
86 return _validities;
87 }
88
89 private:
90 friend MapBuilder;
91
93
95
97
98 double _s;
99
100 double _t;
101
102 std::string _orientation;
103
104 std::vector<LaneValidity> _validities;
105 };
106
107} // namespace element
108} // namespace road
109} // namespace carla
bool GetDynamic() const
Definition Signal.h:97
void AcceptVisitor(RoadInfoVisitor &v) final
RoadInfoSignal(SignId signal_id, RoadId road_id, double s, double t, std::string orientation)
RoadInfoSignal(SignId signal_id, Signal *signal, RoadId road_id, double s, double t, std::string orientation)
std::vector< LaneValidity > _validities
const std::vector< LaneValidity > & GetValidities() const
SignalOrientation GetOrientation() const
SignalOrientation
Definition Signal.h:21
uint32_t RoadId
Definition RoadTypes.h:15
std::string SignId
Definition RoadTypes.h:25
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133