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
5
#include "
common_lib/structures/position.hpp
"
6
7
namespace
common_lib::structures
{
8
9
struct
PathPoint
{
10
Position
position
;
11
double
orientation
;
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
32
namespace
std
{
33
34
template
<>
35
struct
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
common_lib::structures
Definition
cone.hpp:10
common_lib
Definition
weight_transfer.hpp:7
std
Hash function for cones.
Definition
cone.hpp:36
position.hpp
common_lib::structures::PathPoint
Definition
path_point.hpp:9
common_lib::structures::PathPoint::operator==
friend bool operator==(const PathPoint &lhs, const PathPoint &rhs)
Definition
path_point.hpp:21
common_lib::structures::PathPoint::PathPoint
PathPoint(PathPoint const &path_point)=default
common_lib::structures::PathPoint::position
Position position
Definition
path_point.hpp:10
common_lib::structures::PathPoint::ideal_velocity
double ideal_velocity
Definition
path_point.hpp:12
common_lib::structures::PathPoint::PathPoint
PathPoint()=default
common_lib::structures::PathPoint::getX
double getX() const
common_lib::structures::PathPoint::getY
double getY() const
common_lib::structures::PathPoint::orientation
double orientation
Definition
path_point.hpp:11
common_lib::structures::Position
Definition
position.hpp:7
std::hash< common_lib::structures::PathPoint >::operator()
size_t operator()(const common_lib::structures::PathPoint &path_point) const noexcept
Definition
path_point.hpp:36
src
common_lib
include
common_lib
structures
path_point.hpp
Generated by
1.9.8