mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 05:53:34 +08:00
vehicle_local_position: rename yaw -> heading and add reset logic
- vehicle_global_position yaw removed (redundant)
This commit is contained in:
committed by
Mathieu Bresciani
parent
33fb9d0c62
commit
97fc1db768
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user