|
|
|
@ -78,6 +78,30 @@ void Tracker::send_attitude(mavlink_channel_t chan)
@@ -78,6 +78,30 @@ void Tracker::send_attitude(mavlink_channel_t chan)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Tracker::send_extended_status1(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
int16_t battery_current = -1; |
|
|
|
|
int8_t battery_remaining = -1; |
|
|
|
|
|
|
|
|
|
if (battery.has_current() && battery.healthy()) { |
|
|
|
|
battery_remaining = battery.capacity_remaining_pct(); |
|
|
|
|
battery_current = battery.current_amps() * 100; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mavlink_msg_sys_status_send( |
|
|
|
|
chan, |
|
|
|
|
0, |
|
|
|
|
0, |
|
|
|
|
0, |
|
|
|
|
static_cast<uint16_t>(scheduler.load_average() * 1000), |
|
|
|
|
battery.voltage() * 1000, // mV
|
|
|
|
|
battery_current, // in 10mA units
|
|
|
|
|
battery_remaining, // in %
|
|
|
|
|
0, // comm drops %,
|
|
|
|
|
0, // comm drops in pkts,
|
|
|
|
|
0, 0, 0, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Tracker::send_location(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
uint32_t fix_time; |
|
|
|
@ -201,6 +225,11 @@ bool GCS_MAVLINK_Tracker::try_send_message(enum ap_message id)
@@ -201,6 +225,11 @@ bool GCS_MAVLINK_Tracker::try_send_message(enum ap_message id)
|
|
|
|
|
tracker.send_simstate(chan); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case MSG_EXTENDED_STATUS1: |
|
|
|
|
CHECK_PAYLOAD_SIZE(SYS_STATUS); |
|
|
|
|
tracker.send_extended_status1(chan); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
return GCS_MAVLINK::try_send_message(id); |
|
|
|
|
} |
|
|
|
|