MCU
Loading...
Searching...
No Matches
lib
shared_data
include
Utility.h
Go to the documentation of this file.
1
#ifndef __UTILITY_H__
2
#define __UTILITY_H__
3
#include "
PhysicalParameters.h
"
4
#include <array>
5
// Defines
6
const
int
FL
= 0;
7
const
int
FR
= 1;
8
const
int
RL
= 2;
9
const
int
RR
= 3;
10
const
int
NUM_MOTORS
= 4;
11
12
const
int
DEBOUNCE_MILLIS
= 10;
// milliseconds before registering another button press
13
15
template
<
typename
T>
16
struct
veh_vec
17
{
18
public
:
19
T
FL
;
20
T
FR
;
21
T
RL
;
22
T
RR
;
23
24
public
:
25
veh_vec
() =
default
;
26
veh_vec
(T _FL, T _FR, T _RL, T _RR)
27
{
28
FL
= _FL;
29
FR
= _FR;
30
RL
= _RL;
31
RR
= _RR;
32
}
33
35
void
copy_to_arr
(T (&arr_out)[4])
36
{
37
arr_out[0] =
FL
;
38
arr_out[1] =
FR
;
39
arr_out[2] =
RL
;
40
arr_out[3] =
RR
;
41
}
42
};
43
44
template
<
typename
T>
45
struct
xyz_vec
46
{
47
T
x
;
48
T
y
;
49
T
z
;
50
};
51
52
template
<
typename
T>
53
struct
xy_vec
54
{
55
T
x
;
56
T
y
;
57
};
58
59
#endif
/* __UTILITY_H__ */
PhysicalParameters.h
RR
const int RR
Definition:
Utility.h:9
FL
const int FL
Definition:
Utility.h:6
FR
const int FR
Definition:
Utility.h:7
DEBOUNCE_MILLIS
const int DEBOUNCE_MILLIS
Definition:
Utility.h:12
RL
const int RL
Definition:
Utility.h:8
NUM_MOTORS
const int NUM_MOTORS
Definition:
Utility.h:10
veh_vec
generic data vector type that can be used with tire and / or anything to do with 4 corners of the car...
Definition:
Utility.h:17
veh_vec::copy_to_arr
void copy_to_arr(T(&arr_out)[4])
copy values to array in FL, FR, RL, RR order
Definition:
Utility.h:35
veh_vec::veh_vec
veh_vec(T _FL, T _FR, T _RL, T _RR)
Definition:
Utility.h:26
veh_vec::FL
T FL
Definition:
Utility.h:19
veh_vec::RL
T RL
Definition:
Utility.h:21
veh_vec::veh_vec
veh_vec()=default
veh_vec::RR
T RR
Definition:
Utility.h:22
veh_vec::FR
T FR
Definition:
Utility.h:20
xy_vec
Definition:
Utility.h:54
xy_vec::x
T x
Definition:
Utility.h:55
xy_vec::y
T y
Definition:
Utility.h:56
xyz_vec
Definition:
Utility.h:46
xyz_vec::z
T z
Definition:
Utility.h:49
xyz_vec::x
T x
Definition:
Utility.h:47
xyz_vec::y
T y
Definition:
Utility.h:48
Generated by
1.9.5