Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
grid_index.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
11struct GridIndex {
12 int x;
13 int y;
14
15 bool operator==(const GridIndex& other) const { return x == other.x && y == other.y; }
16};
17
21namespace std {
22template <>
23struct hash<GridIndex> {
24 std::size_t operator()(const GridIndex& k) const noexcept {
25 return std::hash<int>()(k.x) ^ (std::hash<int>()(k.y) << 1);
26 }
27};
28} // namespace std
Hash function for cones.
Definition cone.hpp:36
Structure to represent a grid index with x and y coordinates, needed for grid mapping.
bool operator==(const GridIndex &other) const
std::size_t operator()(const GridIndex &k) const noexcept