Skyward boardcore
Loading...
Searching...
No Matches
BMX160Data.h
Go to the documentation of this file.
1/* Copyright (c) 2020 Skyward Experimental Rocketry
2 * Author: Davide Mor
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 public GyroscopeData,
32 public MagnetometerData
33{
35 : AccelerometerData{0, 0.0, 0.0, 0.0}, GyroscopeData{0, 0.0, 0.0, 0.0},
36 MagnetometerData{0, 0.0, 0.0, 0.0}
37 {
38 }
39
44
45 static std::string header()
46 {
47 return "accelerationTimestamp,accelerationX,accelerationY,"
48 "accelerationZ,angularSpeedTimestamp,angularSpeedX,"
49 "angularSpeedY,angularSpeedZ,magneticFieldTimestamp,"
50 "magneticFieldX,magneticFieldY,magneticFieldZ\n";
51 }
52
53 void print(std::ostream& os) const
54 {
55 os << accelerationTimestamp << "," << accelerationX << ","
56 << accelerationY << "," << accelerationZ << ","
57 << angularSpeedTimestamp << "," << angularSpeedX << ","
58 << angularSpeedY << "," << angularSpeedZ << ","
59 << magneticFieldTimestamp << "," << magneticFieldX << ","
60 << magneticFieldY << "," << magneticFieldZ << "\n";
61 }
62};
63
65{
66 static std::string header() { return "temperatureTimestamp,temperature\n"; }
67
68 void print(std::ostream& os) const
69 {
70 os << temperatureTimestamp << "," << temperature << "\n";
71 }
72};
73
78{
79 uint64_t timestamp;
80
82 // the fifo)
83 uint64_t fifoDuration;
84 uint64_t
86 // interrupt and the current one.
87 int len;
88
89 static std::string header()
90 {
91 return "timestamp,watermark_timestamp,fifo_duration,interrupt_"
92 "timestamp_delta,fifo_len\n";
93 }
94
95 void print(std::ostream& os) const
96 {
97 os << timestamp << "," << watermarkTimestamp << "," << fifoDuration
98 << "," << interruptTimestampDelta << "," << len << "\n";
99 }
100};
101
102} // namespace Boardcore
This file includes all the types the logdecoder script will decode.
Structure to handle accelerometer data.
Definition SensorData.h:121
void print(std::ostream &os) const
Definition BMX160Data.h:53
BMX160Data(AccelerometerData acc, GyroscopeData gyr, MagnetometerData mag)
Definition BMX160Data.h:40
static std::string header()
Definition BMX160Data.h:45
BMX160 fifo statistics.
Definition BMX160Data.h:78
uint64_t fifoDuration
Total fifo duration.
Definition BMX160Data.h:83
static std::string header()
Definition BMX160Data.h:89
int len
Fifo length in bytes.
Definition BMX160Data.h:87
uint64_t interruptTimestampDelta
Reported delta time between the previous.
Definition BMX160Data.h:85
uint64_t watermarkTimestamp
Watermark timestamp (from the start of.
Definition BMX160Data.h:81
void print(std::ostream &os) const
Definition BMX160Data.h:95
static std::string header()
Definition BMX160Data.h:66
void print(std::ostream &os) const
Definition BMX160Data.h:68
Structure to handle gyroscope data.
Definition SensorData.h:207
Structure to handle magnetometer data.
Definition SensorData.h:249