CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
road
element
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
9
#include "
carla/road/RoadTypes.h
"
10
11
#include <cstdint>
12
#include <functional>
13
14
namespace
carla
{
15
namespace
road {
16
namespace
element {
17
18
struct
Waypoint
{
19
20
RoadId
road_id
= 0u;
21
22
SectionId
section_id
= 0u;
23
24
LaneId
lane_id
= 0;
25
26
double
s
= 0.0;
27
};
28
29
}
// namespace element
30
}
// namespace road
31
}
// namespace carla
32
33
namespace
std
{
34
35
template
<>
36
struct
hash<
carla
::road::element::Waypoint> {
37
38
using
argument_type
=
carla::road::element::Waypoint
;
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
51
namespace
carla
{
52
namespace
road {
53
namespace
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
RoadTypes.h
carla::road::element::operator==
bool operator==(const Waypoint &lhs, const Waypoint &rhs)
Definition
road/element/Waypoint.h:55
carla::road::element::operator!=
bool operator!=(const Waypoint &lhs, const Waypoint &rhs)
Definition
road/element/Waypoint.h:60
carla::road::SectionId
uint32_t SectionId
Definition
RoadTypes.h:21
carla::road::LaneId
int32_t LaneId
Definition
RoadTypes.h:19
carla::road::RoadId
uint32_t RoadId
Definition
RoadTypes.h:15
carla
This file contains definitions of common data structures used in traffic manager.
Definition
Carla.cpp:133
std
Definition
CarlaRecorderCollision.h:31
carla::road::element::Waypoint
Definition
road/element/Waypoint.h:18
carla::road::element::Waypoint::section_id
SectionId section_id
Definition
road/element/Waypoint.h:22
carla::road::element::Waypoint::road_id
RoadId road_id
Definition
road/element/Waypoint.h:20
carla::road::element::Waypoint::lane_id
LaneId lane_id
Definition
road/element/Waypoint.h:24
carla::road::element::Waypoint::s
double s
Definition
road/element/Waypoint.h:26
std::hash< carla::road::element::Waypoint >::result_type
uint64_t result_type
Definition
road/element/Waypoint.h:40
制作者
1.10.0