CARLA
RoadInfoLaneAccess.h
Go to the documentation of this file.
1 // Copyright (c) 2017 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 #include <string>
11 
12 namespace carla {
13 namespace road {
14 namespace element {
15 
16  /// This record defines access restrictions for certain types of road users.
17  /// The record can be used to complement restrictions resulting from signs or
18  /// signals in order to control the traffic flow in a scenario. Each entry is
19  /// valid in direction of the increasing s co-ordinate until a new entry is
20  /// defined. If multiple entries are defined, they must be listed in
21  /// increasing order.
22  class RoadInfoLaneAccess final : public RoadInfo {
23  public:
24 
26  double s, // start position relative to the position of the preceding
27  // lane section
28  std::string restriction)
29  : RoadInfo(s),
30  _restriction(restriction) {}
31 
32  void AcceptVisitor(RoadInfoVisitor &v) final {
33  v.Visit(*this);
34  }
35 
36  const std::string &GetRestriction() const {
37  return _restriction;
38  }
39 
40  private:
41 
42  const std::string _restriction; // Examples: Simulator, Autonomous Traffic,
43  // Pedestrian and None
44  };
45 
46 } // namespace element
47 } // namespace road
48 } // namespace carla
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
const std::string & GetRestriction() const
RoadInfoLaneAccess(double s, std::string restriction)
This record defines access restrictions for certain types of road users.
void AcceptVisitor(RoadInfoVisitor &v) final