CARLA
Loading...
Searching...
No Matches
LibCarla
source
carla
road
element
road/element/Waypoint.cpp
Go to the documentation of this file.
1
// Copyright (c) 2026 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
#include <boost/container_hash/hash.hpp>
9
10
namespace
std
{
11
12
using
WaypointHash
= hash<carla::road::element::Waypoint>;
13
14
WaypointHash::result_type
WaypointHash::operator()
(
const
argument_type
&waypoint)
const
{
15
WaypointHash::result_type
seed = 0u;
16
boost::hash_combine(seed, waypoint.
road_id
);
17
boost::hash_combine(seed, waypoint.
section_id
);
18
boost::hash_combine(seed, waypoint.
lane_id
);
19
boost::hash_combine(seed,
static_cast<
float
>
(std::floor(waypoint.
s
* 200.0)));
20
return
seed;
21
}
22
23
}
// namespace std
std
Definition
CarlaRecorderCollision.h:31
Waypoint.h
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 >
Definition
road/element/Waypoint.h:36
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:14
std::hash< carla::road::element::Waypoint >::result_type
uint64_t result_type
Definition
road/element/Waypoint.h:40
Generated by
1.9.8