Skip to content
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

Merged
merged 3 commits into from
Jun 29, 2024
Merged

GS USB Streaming #374

merged 3 commits into from
Jun 29, 2024

Conversation

jbinz
Copy link
Collaborator

@jbinz jbinz commented Feb 3, 2024

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

  • Feature tested manually [Mandatory]
  • Simulation flight performed [Optional]
  • Drone flight performed [Optional]
  • Copyright notice for new files
  • #pragma once directive for new header files

Checklist for Releases

  • Simulation flight performed [Mandatory]
  • Drone flight performed [Optional]
  • Version number incremented [Mandatory]
  • Develop and debug flag disabled [Mandatory]

Related issues

#347

@jbinz jbinz requested review from stojadin2701 and l-jost and removed request for stojadin2701 February 10, 2024 13:54
@@ -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);
Copy link
Member

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
Copy link
Member

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",
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@@ -43,6 +41,9 @@ void setup() {

void loop() {
static bool ini{false};
static uint16_t link1LastTs{0};
Copy link
Member

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?

Copy link
Collaborator Author

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

@@ -8,6 +8,8 @@

#pragma once

#include "telemetry/telemetry.hpp"
Copy link
Member

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);
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FC's -> FCs

jbinz added 3 commits June 29, 2024 10:45
In single mode, stream whichever link updated faster.
In dual mode, stream both links.
@stojadin2701 stojadin2701 merged commit a135223 into main Jun 29, 2024
4 checks passed
@stojadin2701 stojadin2701 deleted the gs-usb-streaming branch June 29, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants