-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathFourierHandle.h
More file actions
68 lines (55 loc) · 1.19 KB
/
FourierHandle.h
File metadata and controls
68 lines (55 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* \file FourierHandle.h
* \author Emek Baris Kucuktabak
* \brief A class for the Fourier button handles
* \version 0.2
* \date 2026-03-04
* \copyright Copyright (c) 2020 - 2026
*
*/
#ifndef SRC_FOURIERHANDLE_H
#define SRC_FOURIERHANDLE_H
#include <sstream>
#include <numeric>
#include <Eigen/Core>
#include "InputDevice.h"
#include "CANDevice.h"
enum ButtonColor {
RED = 0,
BLUE = 1,
YELLOW = 2,
GREEN = 3
};
/**
* \ingroup IO
*
*/
class FourierHandle : public InputDevice, public CANDevice {
public:
/**
* Construct a new FourierHandle object
*
*/
FourierHandle(int sensor_can_node_ID);
/**
* Configure Master (controller) side PDO for button value reading.
*
*/
bool configureMasterPDOs();
/**
* Updates the button readings from last updated PDO
*
*/
void updateInput();
/**
* Returns the lastest updated button reading.
*
*/
Eigen::VectorXd& getButtonValues();
private:
int sensorNodeID_;
RPDO *rpdo_;
INTEGER32 rawData_[4] = {0};
Eigen::VectorXd buttonValues_; // Values of red, blue, yellow, and green, respectively. if pressed 1, else 0
};
#endif //SRC_FOURIERHANDLE_H