Skip to content

Commit

Permalink
AP_GPS: If FIX_TYPE is less than or equal to NO_FIX, do not send tele…
Browse files Browse the repository at this point in the history
…metry
  • Loading branch information
muramura committed Sep 27, 2024
1 parent 0ce307c commit c71522a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/AP_GPS/AP_GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ uint16_t AP_GPS::gps_yaw_cdeg(uint8_t instance) const

void AP_GPS::send_mavlink_gps_raw(mavlink_channel_t chan)
{
if (params[0].type == GPS_TYPE_NONE) { // If none, do not send telemetry.
if (params[0].type == GPS_TYPE_NONE || status(0) < GPS_OK_FIX_2D) { // If none, do not send telemetry.
return;
}

Expand Down Expand Up @@ -1409,7 +1409,7 @@ void AP_GPS::send_mavlink_gps_raw(mavlink_channel_t chan)
void AP_GPS::send_mavlink_gps2_raw(mavlink_channel_t chan)
{
// always send the message if 2nd GPS is configured
if (params[1].type == GPS_TYPE_NONE) {
if (params[1].type == GPS_TYPE_NONE || status(1) < GPS_OK_FIX_2D) {
return;
}

Expand Down

0 comments on commit c71522a

Please sign in to comment.