Skip to content

State Estimations & Telemetry Updates - #65

Open
ETSells wants to merge 6 commits into
mainfrom
integration/state-estims-telemetry
Open

State Estimations & Telemetry Updates#65
ETSells wants to merge 6 commits into
mainfrom
integration/state-estims-telemetry

Conversation

@ETSells

@ETSells ETSells commented Jul 6, 2026

Copy link
Copy Markdown
Member

Support for the state estimations epic as well as a basic ground station emulator implementation.

Closes: #56

Parent: SunDevilRocketry/Flight-Computer-Firmware#301

@butchhartman butchhartman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only real CR is to put duplicated serial port code from emulator_uart.c into helper functions.

} TELEM_STATE;

static TELEM_STATE state_buf[8] = {
[0 ... 7] = { .timestamp_available = 0xFFFFFFFF } /* GNU ONLY */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is some evil syntax dude 😭

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

would rather do this than have an initialization function, although ig i could do it on serial port init. either way we've committed to the GNU ecosystem so i'm gonna leave it doing this at initialization time :)

Comment thread src/emulator_ground_station.c Outdated
/* Prompt for serial port */
char port_buf[12];
emulator_log("Please enter your serial port in the format /dev/ttyXX or in the format COMX.", EMULATOR_SUBSYSTEM_GS);
#if defined( _WIN32 ) || defined( __CYGWIN__ )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove empty conddef block

Comment thread src/emulator_ground_station.c Outdated
// ETS: THIS IS GROSS. Do not do this.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-truncation"
snprintf(port_buf, 12, "/dev/ttyS%u", last_two_digits);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use sizeof(port_buf)

Comment thread src/emulator_lora.c
@@ -0,0 +1,529 @@
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only complaint here is magic numbers but If I recall that's a problem with lora in general so probably fine to ignore until that's changed in the firmware

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeahhhhhh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The serial port code looks like its the exact same as in emulator_uart.c. I would recommend separating the code for opening, reading, and writing a serial port to helper functions in a file like emulator_serial.c or something.

Comment thread src/emulator_ground_station.c Outdated
return false;
}

port_buf[strcspn(port_buf, "\n")] = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably best for this to be a '\0' for clarity.

@ETSells
ETSells requested a review from butchhartman July 7, 2026 01:15
@ETSells

ETSells commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

only one unaddressed is the LoRa thing bc you're 100% right lmao. rereview ready

@butchhartman butchhartman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

meowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeow

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.

Telemetry: Implement a mock interface for telemetry and the ground station

2 participants