Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion MIDAS/src/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ TelemetryPacket Telemetry::makePacket(RocketData& data) {
uint8_t sat_count = gps.fix_type;
packet.fsm_callsign_satcount = ((uint8_t)fsm) | (sat_count << 4);
float kf_vx_clamped = std::clamp(kalman.velocity.vx, -2000.f, 2000.f);
packet.kf_vx = (uint16_t) ((kf_vx_clamped + 2000) / 4000. * ((1 << 16) - 1));
// freaky
packet.kf_vx = (uint16_t) ((kf_vx_clamped + 2000.f) / 4000.f * ((1 << 16) - 1));

#ifdef IS_SUSTAINER
packet.fsm_callsign_satcount |= (1 << 7);
Expand Down