CARLA
 
载入中...
搜索中...
未找到
road/element/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
10
11#include <cstdint>
12#include <functional>
13
14namespace carla {
15namespace road {
16namespace element {
17
18 struct Waypoint {
19
21
23
25
26 double s = 0.0;
27 };
28
29} // namespace element
30} // namespace road
31} // namespace carla
32
33namespace std {
34
35 template <>
36 struct hash<carla::road::element::Waypoint> {
37
39
40 using result_type = uint64_t;
41
42 /// Generates an unique id for @a waypoint based on its road_id, lane_id,
43 /// section_id, and "s" offset. The "s" offset is truncated to half
44 /// centimetre precision.
45 result_type operator()(const argument_type &waypoint) const;
46
47 };
48
49} // namespace std
50
51namespace carla {
52namespace road {
53namespace element {
54
55 inline bool operator==(const Waypoint &lhs, const Waypoint &rhs) {
56 auto hasher = std::hash<Waypoint>();
57 return hasher(lhs) == hasher(rhs);
58 }
59
60 inline bool operator!=(const Waypoint &lhs, const Waypoint &rhs) {
61 return !operator==(lhs, rhs);
62 }
63
64} // namespace element
65} // namespace road
66} // namespace carla
bool operator==(const Waypoint &lhs, const Waypoint &rhs)
bool operator!=(const Waypoint &lhs, const Waypoint &rhs)
uint32_t SectionId
Definition RoadTypes.h:21
int32_t LaneId
Definition RoadTypes.h:19
uint32_t RoadId
Definition RoadTypes.h:15
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133