CARLA
Landmark.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/Memory.h"
10 #include "carla/client/Waypoint.h"
11 #include "carla/geom/Transform.h"
12 #include "carla/geom/BoundingBox.h"
13 
15 
16 #include <string>
17 
18 namespace carla {
19 namespace client {
20 
21  /// Class containing a reference to RoadInfoSignal
22  class Landmark {
23  public:
24 
26  return _waypoint;
27  }
28 
29  const geom::Transform &GetTransform() const {
30  return _signal->GetSignal()->GetTransform();
31  }
32 
34  return _signal->GetRoadId();
35  }
36 
37  double GetDistance() const {
38  return _distance_from_search;
39  }
40 
41  double GetS() const {
42  return _signal->GetS();
43  }
44 
45  double GetT() const {
46  return _signal->GetT();
47  }
48 
49  std::string GetId() const {
50  return _signal->GetSignalId();
51  }
52 
53  std::string GetName() const {
54  return _signal->GetSignal()->GetName();
55  }
56 
57  bool IsDynamic() const {
58  return _signal->IsDynamic();
59  }
60 
62  return _signal->GetOrientation();
63  }
64 
65  double GetZOffset() const {
66  return _signal->GetSignal()->GetZOffset();
67  }
68 
69  std::string GetCountry() const {
70  return _signal->GetSignal()->GetCountry();
71  }
72 
73  std::string GetType() const {
74  return _signal->GetSignal()->GetType();
75  }
76 
77  std::string GetSubType() const {
78  return _signal->GetSignal()->GetSubtype();
79  }
80 
81  double GetValue() const {
82  return _signal->GetSignal()->GetValue();
83  }
84 
85  std::string GetUnit() const {
86  return _signal->GetSignal()->GetUnit();
87  }
88 
89  double GetHeight() const {
90  return _signal->GetSignal()->GetHeight();
91  }
92 
93  double GetWidth() const {
94  return _signal->GetSignal()->GetWidth();
95  }
96 
97  std::string GetText() const {
98  return _signal->GetSignal()->GetText();
99  }
100 
101  double GethOffset() const {
102  return _signal->GetSignal()->GetHOffset();
103  }
104 
105  double GetPitch() const {
106  return _signal->GetSignal()->GetPitch();
107  }
108 
109  double GetRoll() const {
110  return _signal->GetSignal()->GetRoll();
111  }
112 
113  const auto &GetValidities() const {
114  return _signal->GetValidities();
115  }
116 
117  private:
118 
119  friend Waypoint;
120  friend Map;
121 
123  SharedPtr<Waypoint> waypoint,
124  SharedPtr<const Map> parent,
125  const road::element::RoadInfoSignal* signal,
126  double distance_from_search = 0)
127  : _waypoint(waypoint),
128  _parent(parent),
129  _signal(signal),
130  _distance_from_search(distance_from_search) {}
131 
132  /// waypoint where the signal is affecting
134 
136 
138 
140  };
141 
142 } // client
143 } // carla
road::RoadId GetRoadId() const
Definition: Landmark.h:33
uint32_t RoadId
Definition: RoadTypes.h:15
const std::string & GetUnit() const
Definition: Signal.h:139
double GetHOffset() const
Definition: Signal.h:155
bool IsDynamic() const
Definition: Landmark.h:57
double GetValue() const
Definition: Signal.h:135
std::string GetUnit() const
Definition: Landmark.h:85
std::string GetName() const
Definition: Landmark.h:53
std::string GetText() const
Definition: Landmark.h:97
SharedPtr< Waypoint > _waypoint
waypoint where the signal is affecting
Definition: Landmark.h:133
double GetValue() const
Definition: Landmark.h:81
const auto & GetValidities() const
Definition: Landmark.h:113
Landmark(SharedPtr< Waypoint > waypoint, SharedPtr< const Map > parent, const road::element::RoadInfoSignal *signal, double distance_from_search=0)
Definition: Landmark.h:122
SignalOrientation
Definition: Signal.h:21
double GetT() const
Definition: Landmark.h:45
double GetHeight() const
Definition: Landmark.h:89
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Definition: Memory.h:20
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
double GetZOffset() const
Definition: Signal.h:119
SignalOrientation GetOrientation() const
double GetS() const
Definition: Landmark.h:41
Class containing a reference to RoadInfoSignal.
Definition: Landmark.h:22
const std::string & GetText() const
Definition: Signal.h:151
std::string GetId() const
Definition: Landmark.h:49
double GetWidth() const
Definition: Landmark.h:93
const geom::Transform & GetTransform() const
Definition: Landmark.h:29
const Signal * GetSignal() const
double GetPitch() const
Definition: Landmark.h:105
std::string GetType() const
Definition: Landmark.h:73
const std::string & GetType() const
Definition: Signal.h:127
road::SignalOrientation GetOrientation() const
Definition: Landmark.h:61
double GetRoll() const
Definition: Landmark.h:109
double _distance_from_search
Definition: Landmark.h:139
double GethOffset() const
Definition: Landmark.h:101
double GetPitch() const
Definition: Signal.h:159
std::string GetSubType() const
Definition: Landmark.h:77
SharedPtr< Waypoint > GetWaypoint() const
Definition: Landmark.h:25
std::string GetCountry() const
Definition: Landmark.h:69
const std::vector< LaneValidity > & GetValidities() const
double GetZOffset() const
Definition: Landmark.h:65
const geom::Transform & GetTransform() const
Definition: Signal.h:172
const std::string & GetName() const
Definition: Signal.h:105
double GetWidth() const
Definition: Signal.h:147
const std::string & GetSubtype() const
Definition: Signal.h:131
double GetDistance() const
Definition: Landmark.h:37
double GetRoll() const
Definition: Signal.h:163
const std::string & GetCountry() const
Definition: Signal.h:123
const road::element::RoadInfoSignal * _signal
Definition: Landmark.h:137
SharedPtr< const Map > _parent
Definition: Landmark.h:135
double GetHeight() const
Definition: Signal.h:143