CARLA
RoadInfoSignal.h
Go to the documentation of this file.
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 
12 namespace carla {
13 namespace road {
14 namespace 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 
47  void AcceptVisitor(RoadInfoVisitor &v) final {
48  v.Visit(*this);
49  }
50 
51  SignId GetSignalId() const {
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
std::string SignId
Definition: RoadTypes.h:25
uint32_t RoadId
Definition: RoadTypes.h:15
SignalOrientation
Definition: Signal.h:21
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
SignalOrientation GetOrientation() const
RoadInfoSignal(SignId signal_id, RoadId road_id, double s, double t, std::string orientation)
void AcceptVisitor(RoadInfoVisitor &v) final
const Signal * GetSignal() const
bool GetDynamic() const
Definition: Signal.h:97
RoadInfoSignal(SignId signal_id, Signal *signal, RoadId road_id, double s, double t, std::string orientation)
const std::vector< LaneValidity > & GetValidities() const
std::vector< LaneValidity > _validities