Fix heading check delta on cam.

This commit is contained in:
Diogo Jesus 2024-03-21 14:33:00 +00:00
parent 4d61a6b21d
commit af66066235
1 changed files with 3 additions and 2 deletions

View File

@ -680,8 +680,9 @@ int lightship_check() {
itss_space_get();
// Check heading delta > 4º
int diff = ((epv.space.heading - lightship->last_pos.heading) + 180) % 360 - 180;
if (diff > 40) rv = 1;
int diff = epv.space.heading - lightship->last_pos.heading;
diff += (diff > 180) ? -360 : (diff < -180) ? 360 : 0;
if (abs(diff) > 40) rv = 1;
if (!rv) {
// Check speed delta > 0.5 m/s