CARLA
LibCarla
source
carla
road
element
road/element/Waypoint.cpp
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
#include "
carla/road/element/Waypoint.h
"
8
9
#include <boost/container_hash/hash.hpp>
10
11
namespace
std
{
12
13
using
WaypointHash
=
hash<carla::road::element::Waypoint>
;
14
15
WaypointHash::result_type
WaypointHash::operator()
(
const
argument_type
&waypoint)
const
{
16
WaypointHash::result_type
seed = 0u;
17
boost::hash_combine(seed, waypoint.
road_id
);
18
boost::hash_combine(seed, waypoint.
section_id
);
19
boost::hash_combine(seed, waypoint.
lane_id
);
20
boost::hash_combine(seed, static_cast<float>(std::floor(waypoint.
s
* 200.0)));
21
return
seed;
22
}
23
24
}
// namespace std
std::hash< carla::road::element::Waypoint >::result_type
uint64_t result_type
Definition:
road/element/Waypoint.h:40
std
Definition:
CarlaRecorderCollision.h:30
carla::road::element::Waypoint::road_id
RoadId road_id
Definition:
road/element/Waypoint.h:20
std::hash< carla::road::element::Waypoint >
Definition:
road/element/Waypoint.h:36
Waypoint.h
carla::road::element::Waypoint::s
double s
Definition:
road/element/Waypoint.h:26
carla::road::element::Waypoint::lane_id
LaneId lane_id
Definition:
road/element/Waypoint.h:24
carla::road::element::Waypoint::section_id
SectionId section_id
Definition:
road/element/Waypoint.h:22
carla::road::element::Waypoint
Definition:
road/element/Waypoint.h:18
std::hash< carla::road::element::Waypoint >::operator()
result_type operator()(const argument_type &waypoint) const
Generates an unique id for waypoint based on its road_id, lane_id, section_id, and "s" offset...
Definition:
road/element/Waypoint.cpp:15
Generated by
1.8.13