File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
- #pragma once
1
+ #ifndef COMMAND_HPP
2
+ #define COMMAND_HPP
2
3
#include < vector>
3
4
#include < chrono>
4
5
5
6
// A command is a simple instruction to the vehicle
6
7
// Commands will be combined in sequencing to create more complex instructions
7
8
9
+
8
10
enum Direction {Forwards, Backwards};
9
11
10
12
struct force_array {
@@ -14,6 +16,15 @@ struct pwm_array {
14
16
int pwm_signals[8 ];
15
17
};
16
18
19
+ bool inline operator ==(const pwm_array& lhs, const pwm_array& rhs) {
20
+ for (int i = 0 ; i < 8 ; i++) {
21
+ if (lhs.pwm_signals [i] != rhs.pwm_signals [i]) {
22
+ return false ;
23
+ }
24
+ }
25
+ return true ;
26
+ }
27
+
17
28
struct CommandComponent {
18
29
pwm_array thruster_pwms; // PWM values for each thruster
19
30
std::chrono::milliseconds duration; // Duration of the command in milliseconds
@@ -29,3 +40,5 @@ struct Sequence {
29
40
std::vector<Command> commands;
30
41
};
31
42
43
+ #endif
44
+
You can’t perform that action at this time.
0 commit comments