CARLA
RoadInfoCrosswalk.h
Go to the documentation of this file.
1 // Copyright (c) 2019 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 
10 
11 namespace carla {
12 namespace road {
13 namespace element {
14 
15  struct CrosswalkPoint {
16  double u { 0.0 };
17  double v { 0.0 };
18  double z { 0.0 };
19  CrosswalkPoint(double _u, double _v, double _z) : u(_u), v(_v), z(_z) {};
20  };
21 
22  class RoadInfoCrosswalk final : public RoadInfo {
23  public:
24 
26  const double s,
27  const std::string name,
28  const double t,
29  const double zOffset,
30  const double hdg,
31  const double pitch,
32  const double roll,
33  const std::string orientation,
34  const double width,
35  const double length,
36  const std::vector<CrosswalkPoint> points)
37  : RoadInfo(s),
38  _name(name),
39  _t(t),
40  _zOffset(zOffset),
41  _hdg(hdg),
42  _pitch(pitch),
43  _roll(roll),
44  _orientation(orientation),
45  _width(width),
46  _length(length),
47  _points(points) {}
48 
50  v.Visit(*this);
51  }
52 
53  double GetS() const { return GetDistance(); };
54  double GetT() const { return _t; };
55  double GetWidth() const { return _width; };
56  double GetLength() const { return _length; };
57  double GetHeading() const { return _hdg; };
58  double GetPitch() const { return _pitch; };
59  double GetRoll() const { return _roll; };
60  double GetZOffset() const { return _zOffset; };
61  std::string GetOrientation() const { return _orientation; };
62  const std::vector<CrosswalkPoint> &GetPoints() const { return _points; };
63 
64  private:
65  std::string _name;
66  double _t;
67  double _zOffset;
68  double _hdg;
69  double _pitch;
70  double _roll;
71  std::string _orientation;
72  double _width;
73  double _length;
74  std::vector<CrosswalkPoint> _points;
75  };
76 
77 } // namespace element
78 } // namespace road
79 } // namespace carla
const std::vector< CrosswalkPoint > & GetPoints() const
void AcceptVisitor(RoadInfoVisitor &v) final
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
std::vector< CrosswalkPoint > _points
RoadInfoCrosswalk(const double s, const std::string name, const double t, const double zOffset, const double hdg, const double pitch, const double roll, const std::string orientation, const double width, const double length, const std::vector< CrosswalkPoint > points)
CrosswalkPoint(double _u, double _v, double _z)