-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathdatatypes.hpp
More file actions
95 lines (76 loc) · 2.63 KB
/
datatypes.hpp
File metadata and controls
95 lines (76 loc) · 2.63 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* Copyright (C) 2026 Simon D. Levy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, in version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
namespace hf {
class VehicleState {
public:
float dx; // positive forward
float dy; // positive rightward
float z; // positive upward
float dz; // positive upward
float phi; // positive roll right
float dphi; // positive roll right
float theta; // positive nose down
float dtheta; // positive nose down
float psi; // positive nose right
float dpsi; // positive nose right
VehicleState() = default;
VehicleState
(const float dx,
const float dy,
const float z,
const float dz,
const float phi,
const float dphi,
const float theta,
const float dtheta,
const float psi,
const float dpsi)
:
dx(dx),
dy(dy),
z(z),
dz(dz),
phi(phi),
dphi(dphi),
theta(theta),
dtheta(dtheta),
psi(psi),
dpsi(dpsi) {}
VehicleState& operator=(const VehicleState& other) = default;
};
typedef enum {
MODE_IDLE,
MODE_ARMED,
MODE_HOVERING,
MODE_AUTONOMOUS,
MODE_LANDING,
MODE_PANIC
} mode_e;
class Setpoint {
public:
float thrust; // positve upward
float roll; // positive roll right
float pitch; // positive nose down
float yaw; // positive nose right
Setpoint() = default;
Setpoint
(const float t, const float r, const float p, const float y)
: thrust(t), roll(r), pitch(p), yaw(y) {}
Setpoint& operator=(const Setpoint& other) = default;
};
}