CARLA
 
载入中...
搜索中...
未找到
LaneSection.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
10#include "carla/NonCopyable.h"
11#include "carla/road/Lane.h"
14
15#include <map>
16#include <vector>
17
18namespace carla {
19namespace road {
20
21 class Road;
22 class MapBuilder;
23
25 public:
26
27 explicit LaneSection(SectionId id, double s) : _id(id), _s(s) {}
28
29 double GetDistance() const;
30
31 double GetLength() const;
32
33 Road *GetRoad() const;
34
35 Lane *GetLane(const LaneId id);
36
37 const Lane *GetLane(const LaneId id) const;
38
39 bool ContainsLane(LaneId id) const {
40 return (_lanes.find(id) != _lanes.end());
41 }
42
43 SectionId GetId() const;
44
45 std::map<LaneId, Lane> &GetLanes();
46
47 const std::map<LaneId, Lane> &GetLanes() const;
48
49 std::vector<Lane *> GetLanesOfType(Lane::LaneType type);
50
51 private:
52
53 friend MapBuilder;
54
55 const SectionId _id = 0u;
56
57 const double _s = 0.0;
58
59 Road *_road = nullptr;
60
61 std::map<LaneId, Lane> _lanes;
62
64 };
65
66} // road
67} // carla
Inherit (privately) to suppress copy construction and assignment.
Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3
SectionId GetId() const
double GetDistance() const
Lane * GetLane(const LaneId id)
LaneSection(SectionId id, double s)
Definition LaneSection.h:27
bool ContainsLane(LaneId id) const
Definition LaneSection.h:39
std::map< LaneId, Lane > _lanes
Definition LaneSection.h:61
std::vector< Lane * > GetLanesOfType(Lane::LaneType type)
const SectionId _id
Definition LaneSection.h:55
geom::CubicPolynomial _lane_offset
Definition LaneSection.h:63
std::map< LaneId, Lane > & GetLanes()
LaneType
Can be used as flags
Definition Lane.h:29
uint32_t SectionId
Definition RoadTypes.h:21
int32_t LaneId
Definition RoadTypes.h:19
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133