Skyward boardcore
Loading...
Searching...
No Matches
FollowerData.h
Go to the documentation of this file.
1/* Copyright (c) 2024 Skyward Experimental Rocketry
2 * Author: Emilio Corigliano
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24
25#include <sensors/SensorData.h>
26
27#include <reflect.hpp>
28
29namespace Boardcore
30{
31
33{
34 float n = 0;
35 float e = 0;
36 float d = 0;
37};
38
43{
44 uint64_t timestamp = 0;
45
46 float yaw;
48 float pitch;
50
51 AntennaAngles() : timestamp{0}, yaw{0}, pitch{0} {};
52 AntennaAngles(uint64_t timestamp, float yaw, float pitch)
54 AntennaAngles(uint64_t timestamp, float yaw, float pitch,
55 uint32_t nrPropagations)
57
58 constexpr static auto reflect()
59 {
60 return STRUCT_DEF(AntennaAngles,
61 FIELD_DEF(timestamp) FIELD_DEF(yaw) FIELD_DEF(pitch));
62 }
63};
64
71{
72 uint32_t nrPropagations =
73 0;
74
84
85 static constexpr auto reflect()
86 {
87 return STRUCT_DEF(AntennaAnglesLog,
88 EXTEND_DEF(AntennaAngles) FIELD_DEF(nrPropagations));
89 }
90};
91
97{
98 uint64_t timestamp;
99 float yaw; // [deg]
100 float pitch; // [deg]
103
105 : timestamp(0), yaw(0), pitch(0), horizontalSpeed(0), verticalSpeed(0)
106 {
107 }
108
109 static constexpr auto reflect()
110 {
111 return STRUCT_DEF(FollowerState,
112 FIELD_DEF(timestamp) FIELD_DEF(yaw) FIELD_DEF(pitch)
113 FIELD_DEF(horizontalSpeed)
114 FIELD_DEF(verticalSpeed));
115 }
116};
117
123{
125
126 explicit LogAntennasCoordinates(const GPSData& data) : GPSData(data) {}
127
128 static constexpr auto reflect()
129 {
130 return STRUCT_DEF(LogAntennasCoordinates, EXTEND_DEF(GPSData));
131 }
132};
133
138{
140
141 explicit LogRocketCoordinates(const GPSData& data) : GPSData(data) {}
142
143 static constexpr auto reflect()
144 {
145 return STRUCT_DEF(LogRocketCoordinates, EXTEND_DEF(GPSData));
146 }
147};
148} // namespace Boardcore
Driver for the VN100S IMU.
A structure for storing angles relative to the NED frame.
float pitch
position, positive UP [deg]
static constexpr auto reflect()
AntennaAngles(uint64_t timestamp, float yaw, float pitch, uint32_t nrPropagations)
AntennaAngles(uint64_t timestamp, float yaw, float pitch)
A structure for storing angles relative to the NED frame and the number of propagations that produce ...
AntennaAnglesLog(uint64_t timestamp, float yaw, float pitch, uint32_t nrPropagations)
AntennaAnglesLog(AntennaAngles angle, uint32_t nrPropagations)
uint32_t nrPropagations
Nr of propagations by the propagator (0 if no propagation)
static constexpr auto reflect()
AntennaAnglesLog(uint64_t timestamp, float yaw, float pitch)
State of the Follower algorithm, with the angles and speeds.
static constexpr auto reflect()
Structure to handle GPS data.
Definition SensorData.h:277
A structure for logging the ARP system coordinates set in the Follower.
static constexpr auto reflect()
LogAntennasCoordinates(const GPSData &data)
A structure for logging the Rocket coordinates set in the Follower.
LogRocketCoordinates(const GPSData &data)
static constexpr auto reflect()