CARLA
 
载入中...
搜索中...
未找到
client/Waypoint.h
浏览该文件的文档.
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
9#include "carla/Memory.h"
10#include "carla/NonCopyable.h"
15#include "carla/road/Lane.h"
17
18#include <boost/optional.hpp>
19
20namespace carla {
21namespace client {
22
23 class Map;
24 class Junction;
25 class Landmark;
26
28 : public EnableSharedFromThis<Waypoint>,
29 private NonCopyable {
30 public:
31
33
34 /// Returns an unique Id identifying this waypoint.
35 ///
36 /// The Id takes into account OpenDrive's road Id, lane Id, and s distance
37 /// on its road segment up to half-centimetre precision.
38 uint64_t GetId() const {
39 return std::hash<road::element::Waypoint>()(_waypoint);
40 }
41
42 auto GetRoadId() const {
43 return _waypoint.road_id;
44 }
45
46 auto GetSectionId() const {
47 return _waypoint.section_id;
48 }
49
50 auto GetLaneId() const {
51 return _waypoint.lane_id;
52 }
53
54 auto GetDistance() const {
55 return _waypoint.s;
56 }
57
59 return _transform;
60 }
61
63
64 bool IsJunction() const;
65
67
68 double GetLaneWidth() const;
69
71
72 std::vector<SharedPtr<Waypoint>> GetNext(double distance) const;
73
74 std::vector<SharedPtr<Waypoint>> GetPrevious(double distance) const;
75
76 /// Returns a list of waypoints separated by distance from the current waypoint
77 /// to the end of the lane
78 std::vector<SharedPtr<Waypoint>> GetNextUntilLaneEnd(double distance) const;
79
80 /// Returns a list of waypoints separated by distance from the current waypoint
81 /// to the start of the lane
82 std::vector<SharedPtr<Waypoint>> GetPreviousUntilLaneStart(double distance) const;
83
85
87
88 boost::optional<road::element::LaneMarking> GetRightLaneMarking() const;
89
90 boost::optional<road::element::LaneMarking> GetLeftLaneMarking() const;
91
93
94 /// Returns a list of landmarks from the current position to a certain distance
95 std::vector<SharedPtr<Landmark>> GetAllLandmarksInDistance(
96 double distance, bool stop_at_junction = false) const;
97
98 /// Returns a list of landmarks from the current position to a certain distance
99 /// Filters by specified type
100 std::vector<SharedPtr<Landmark>> GetLandmarksOfTypeInDistance(
101 double distance, std::string filter_type, bool stop_at_junction = false) const;
102
103 private:
104
105 friend class Map;
106
108
110
112
114
115 // Mark record right and left respectively.
116 std::pair<
119 };
120
121} // namespace client
122} // namespace carla
Inherit (privately) to suppress copy/move construction and assignment.
SharedPtr< Waypoint > GetLeft() const
std::vector< SharedPtr< Landmark > > GetLandmarksOfTypeInDistance(double distance, std::string filter_type, bool stop_at_junction=false) const
Returns a list of landmarks from the current position to a certain distance Filters by specified type
road::element::Waypoint _waypoint
SharedPtr< Waypoint > GetRight() const
SharedPtr< const Map > _parent
boost::optional< road::element::LaneMarking > GetLeftLaneMarking() const
boost::optional< road::element::LaneMarking > GetRightLaneMarking() const
road::JuncId GetJunctionId() const
std::vector< SharedPtr< Waypoint > > GetPrevious(double distance) const
const geom::Transform & GetTransform() const
Waypoint(SharedPtr< const Map > parent, road::element::Waypoint waypoint)
road::element::LaneMarking::LaneChange GetLaneChange() const
std::vector< SharedPtr< Waypoint > > GetNext(double distance) const
SharedPtr< Junction > GetJunction() const
std::vector< SharedPtr< Waypoint > > GetNextUntilLaneEnd(double distance) const
Returns a list of waypoints separated by distance from the current waypoint to the end of the lane
std::vector< SharedPtr< Landmark > > GetAllLandmarksInDistance(double distance, bool stop_at_junction=false) const
Returns a list of landmarks from the current position to a certain distance
uint64_t GetId() const
Returns an unique Id identifying this waypoint.
std::vector< SharedPtr< Waypoint > > GetPreviousUntilLaneStart(double distance) const
Returns a list of waypoints separated by distance from the current waypoint to the start of the lane
std::pair< const road::element::RoadInfoMarkRecord *, const road::element::RoadInfoMarkRecord * > _mark_record
road::Lane::LaneType GetType() const
LaneType
Can be used as flags
Definition Lane.h:29
Each lane within a road cross section can be provided with several road markentries.
int32_t JuncId
Definition RoadTypes.h:17
carla::SharedPtr< carla::client::Junction > Junction
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
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
LaneChange
Can be used as flags.
Definition LaneMarking.h:50