Skip to content

Commit

Permalink
Fix altitude data typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Joe-Joe-Joe committed Jul 8, 2024
1 parent 266d1de commit 8db2fd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions STM32Cube/Tasks/trajectory.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ Otits_Result_t test_apogeeQueue() {
}

void trajectory_task(void * argument){
float prev_time = -1;
uint16_t prev_alt = 0xFFFF;
float prev_time;
int32_t prev_alt = INT_MAX;

for(;;)
{
Expand All @@ -279,7 +279,7 @@ void trajectory_task(void * argument){
if(xQueueReceive(altQueue, &altTime, 10) == pdTRUE) {
if(xQueuePeek(extQueue, &ext, 10)== pdTRUE) {
if(xQueuePeek(angleQueue, &angles, 100) == pdTRUE) {
if(prev_alt != 0xFFFF) {
if(prev_alt != INT_MAX) {
float vely = (altTime.alt-prev_alt)*1000.0/(altTime.time-prev_time);
float velx = vely*tan(angles.angle.pitch);
float apogee = get_max_altitude(vely,velx, altTime.alt, ext, ROCKET_BURNOUT_MASS);
Expand Down

0 comments on commit 8db2fd3

Please sign in to comment.