Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
path_point.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
6
8
9struct PathPoint {
12 double ideal_velocity = 1.0;
13
14 PathPoint() = default;
15 PathPoint(Position position, double orientation = 0, double ideal_velocity = 1.0);
16 PathPoint(double x, double y, double orientation = 0, double ideal_velocity = 1.0);
17 PathPoint(PathPoint const& path_point) = default;
18 double getX() const;
19 double getY() const;
20
21 friend bool operator==(const PathPoint& lhs, const PathPoint& rhs) {
22 return lhs.position == rhs.position && lhs.ideal_velocity == rhs.ideal_velocity;
23 }
24};
25
26} // namespace common_lib::structures
27
32namespace std {
33
34template <>
35struct hash<common_lib::structures::PathPoint> {
36 size_t operator()(const common_lib::structures::PathPoint& path_point) const noexcept {
37 size_t hash_value = 0;
38 // Hash the position
39 hash_value ^= hash<common_lib::structures::Position>()(path_point.position);
40 // Hash the ideal_velocity
41 hash_value ^= hash<double>()(path_point.ideal_velocity);
42 return hash_value;
43 }
44};
45
46} // namespace std
Hash function for cones.
Definition cone.hpp:36
friend bool operator==(const PathPoint &lhs, const PathPoint &rhs)
PathPoint(PathPoint const &path_point)=default
size_t operator()(const common_lib::structures::PathPoint &path_point) const noexcept