Skip to content

Commit

Permalink
Update tfmini.c (paparazzi#2460)
Browse files Browse the repository at this point in the history
Tested with TFMini, now works correctly. Gain between 0..1 thus multiply not divide
  • Loading branch information
OpenUAS authored and gautierhattenberger committed Oct 8, 2019
1 parent 6380531 commit 58deebc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sw/airborne/modules/lidar/tfmini.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void tfmini_parse(uint8_t byte)
float phi = stateGetNedToBodyEulers_f()->phi;
float theta = stateGetNedToBodyEulers_f()->theta;
float gain = (float)fabs((double)(cosf(phi) * cosf(theta)));
tfmini.distance = tfmini.distance / gain;
tfmini.distance = tfmini.distance * gain;
}

// send message (if requested)
Expand Down

0 comments on commit 58deebc

Please sign in to comment.