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
27namespace Boardcore
28{
29
31{
32 float n = 0;
33 float e = 0;
34 float d = 0;
35};
36
41{
42 uint64_t timestamp = 0;
43
44 float yaw;
46 float pitch;
48
49 AntennaAngles() : timestamp{0}, yaw{0}, pitch{0} {};
50 AntennaAngles(uint64_t timestamp, float yaw, float pitch)
52 AntennaAngles(uint64_t timestamp, float yaw, float pitch,
53 uint32_t nrPropagations)
55};
56
63{
64 uint32_t nrPropagations =
65 0;
66
76
77 static std::string header()
78 {
79 return "timestamp,yaw,pitch,nrPropagations\n";
80 }
81
82 void print(std::ostream& os) const
83 {
84 os << timestamp << "," << yaw << "," << pitch << "," << nrPropagations
85 << "\n";
86 }
87};
88
94{
95 uint64_t timestamp;
96 float yaw; // [deg]
97 float pitch; // [deg]
100
102 : timestamp(0), yaw(0), pitch(0), horizontalSpeed(0), verticalSpeed(0)
103 {
104 }
105
106 static std::string header()
107 {
108 return "timestamp,yaw,pitch,horizontalSpeed,verticalSpeed\n";
109 }
110
111 void print(std::ostream& os) const
112 {
113 os << timestamp << "," << yaw << "," << pitch << "," << horizontalSpeed
114 << "," << verticalSpeed << "\n";
115 }
116};
117
123{
125
126 explicit LogAntennasCoordinates(const GPSData& data) : GPSData(data) {}
127};
128
133{
135
136 explicit LogRocketCoordinates(const GPSData& data) : GPSData(data) {}
137};
138} // namespace Boardcore
This file includes all the types the logdecoder script will decode.
A structure for storing angles relative to the NED frame.
float pitch
position, positive UP [deg]
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)
void print(std::ostream &os) const
uint32_t nrPropagations
Nr of propagations by the propagator (0 if no propagation)
static std::string header()
AntennaAnglesLog(uint64_t timestamp, float yaw, float pitch)
State of the Follower algorithm, with the angles and speeds.
void print(std::ostream &os) const
static std::string header()
Structure to handle GPS data.
Definition SensorData.h:291
A structure for logging the ARP system coordinates set in the Follower.
LogAntennasCoordinates(const GPSData &data)
A structure for logging the Rocket coordinates set in the Follower.
LogRocketCoordinates(const GPSData &data)