vehicle_local_position: rename yaw -> heading and add reset logic

- vehicle_global_position yaw removed (redundant)
This commit is contained in:
Daniel Agar
2020-08-10 11:42:03 +02:00
committed by Mathieu Bresciani
parent 33fb9d0c62
commit 97fc1db768
24 changed files with 75 additions and 86 deletions
@@ -212,7 +212,7 @@ void frsky_send_frame2(int uart)
int sec = 0;
if (gpos.timestamp != 0 && hrt_absolute_time() < gpos.timestamp + 20000) {
course = gpos.yaw / M_PI_F * 180.0f;
course = lpos.heading / M_PI_F * 180.0f;
if (course < 0.f) { // course is in range [0, 360], 0=north, CW
course += 360.f;
@@ -265,7 +265,7 @@ void sPort_send_GPS_CRS(int uart)
/* send course */
/* convert to 30 bit signed magnitude degrees*6E5 with MSb = 1 and bit 30=sign */
int32_t iYaw = s_port_subscription_data->vehicle_local_position_sub.get().yaw * 18000.0f / M_PI_F;
int32_t iYaw = s_port_subscription_data->vehicle_local_position_sub.get().heading * 18000.0f / M_PI_F;
if (iYaw < 0) { iYaw += 36000; }