forked from core-rocket/ASAHI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
telemetry.hpp
59 lines (49 loc) · 869 Bytes
/
telemetry.hpp
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
#ifndef ASAHI_TELEMETRY_H_
#define ASAHI_TELEMETRY_H_
#define PACKED __attribute__((__packed__))
// 論理ID
constexpr uint8_t id_bus = 0x01;
constexpr uint8_t id_mission = 0x02;
constexpr uint8_t id_station = 0x00;
// 3軸のuint16_tの値
struct Vec16_t {
uint32_t time;
union {
int16_t raw[3];
struct {
int16_t x, y, z;
};
};
} PACKED;
struct Value16 {
uint32_t time;
int16_t val;
} PACKED;
// 32bit float
struct Float32 {
uint32_t time;
union {
uint32_t raw;
float value;
};
} PACKED;
struct Flag {
uint32_t time;
uint8_t flag;
} PACKED;
struct GPS_altitude {
uint32_t time;
uint32_t altitude;
uint32_t altitude_geo;
} PACKED;
struct GPS_time {
uint32_t time;
uint32_t time_int;
uint16_t time_dec;
} PACKED;
struct GPS_vec2 {
uint32_t time;
uint32_t x_int; uint16_t x_dec;
uint32_t y_int; uint16_t y_dec;
} PACKED;
#endif