Skip to content

Commit

Permalink
AP_GPS: Suppress unnecessary telemetry transmission
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Sep 26, 2024
1 parent beb4226 commit fb3dcbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libraries/AP_GPS/AP_GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,10 @@ 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 || drivers[0] == nullptr) {
return;
}

const Location &loc = location(0);
float hacc = 0.0f;
float vacc = 0.0f;
Expand Down Expand Up @@ -1405,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 || drivers[1] == nullptr) {
return;
}

Expand Down

0 comments on commit fb3dcbe

Please sign in to comment.