mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
frsky_telemetry: fix heading for D protocol
This commit is contained in:
parent
1d40336723
commit
4e5c6fc805
@ -248,7 +248,12 @@ void frsky_send_frame2(int uart)
|
||||
time_t time_gps = global_pos->time_utc_usec / 1000000ULL;
|
||||
struct tm *tm_gps = gmtime(&time_gps);
|
||||
|
||||
course = (global_pos->yaw + M_PI_F) / M_PI_F * 180.0f;
|
||||
course = global_pos->yaw / M_PI_F * 180.0f;
|
||||
|
||||
if (course < 0.f) { // course is in range [0, 360], 0=north, CW
|
||||
course += 360.f;
|
||||
}
|
||||
|
||||
lat = frsky_format_gps(fabsf(global_pos->lat));
|
||||
lat_ns = (global_pos->lat < 0) ? 'S' : 'N';
|
||||
lon = frsky_format_gps(fabsf(global_pos->lon));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user