Update tfmini.c (#2460)

Tested with TFMini, now works correctly. Gain between 0..1 thus multiply not divide
This commit is contained in:
OpenUAS
2019-10-08 13:31:54 +02:00
committed by Gautier Hattenberger
parent 63805310d8
commit 58deebc744
+1 -1
View File
@@ -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)