-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GS USB Streaming #374
GS USB Streaming #374
Conversation
aabab82
to
c8b71b9
Compare
496ce34
to
4954d9d
Compare
ground_station/src/main.cpp
Outdated
@@ -67,29 +68,51 @@ void loop() { | |||
|
|||
// In single mode, both antennas track the same rocket | |||
if (systemConfig.config.receiverMode == SINGLE) { | |||
const bool link1DataValid = (link1.data.lat() != 0) && (link1.data.lon() != 0); | |||
const bool link2DataValid = (link2.data.lat() != 0) && (link2.data.lon() != 0); | |||
const bool link1GPSValid = (link1.data.lat() != 0) && (link1.data.lon() != 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct naming: link1GpsValid, also link2GpsValid
@@ -83,5 +82,5 @@ void Parser::cmdGNSSTime(uint8_t *args, uint32_t length) { | |||
|
|||
// NOLINTNEXTLINE(readability-convert-member-functions-to-static) function ptr doesn't work if it's static | |||
void Parser::cmdGNSSInfo(uint8_t *args [[maybe_unused]], uint32_t length [[maybe_unused]]) { | |||
console.log.println("GNSS Info Received"); | |||
// To Do: Do Something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
const auto voltage_prec = static_cast<int32_t>((link->data.voltage() - static_cast<float>(voltage_int)) * 10.0F); | ||
|
||
std::snprintf(print_char, 150, | ||
"Link %d: Ts: %ld.%ld, State: %d, Lat: %ld.%05ld, Lon: %ld.%05ld, Alt: %ld, Vel: %d, V: %ld.%ld", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you paste some sample output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -43,6 +41,9 @@ void setup() { | |||
|
|||
void loop() { | |||
static bool ini{false}; | |||
static uint16_t link1LastTs{0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have 16-bit timestamps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the telemetry sends down 16 bit timestamps
ground_station/src/utils.hpp
Outdated
@@ -8,6 +8,8 @@ | |||
|
|||
#pragma once | |||
|
|||
#include "telemetry/telemetry.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just forward-declare the telemetry struct/class
below all includes:
struct Telemetry; (if struct)
class Telemetry; (if class)
@@ -25,9 +25,14 @@ void setup() { | |||
pinMode(21, INPUT); | |||
|
|||
console.begin(); | |||
#ifdef CATS_DEBUG | |||
console.setLevel(Console::ConsoleLevel::LEVEL_OK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"OK" level is warning level? 😅
navigation.setPointB(link1.data.lat(), link1.data.lon()); | ||
} | ||
} | ||
} else { | ||
// Stream both Links as they track different FC's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FC's -> FCs
In single mode, stream whichever link updated faster. In dual mode, stream both links.
…put if in debug mode.
48ad0a8
to
c76ae53
Compare
Description
This patch implements a USB streaming interface to the ground station.
The data Interface looks as follows:
Link Num [1,2] Timestamp in s, Flight state, Latitude, Longitude, Altitude, Velocity, Battery Voltage
and is updated with 10 Hz if data is received with 10 Hz.
Checklist for changes
#pragma once
directive for new header filesChecklist for Releases
Related issues
#347