Skip to content

Commit

Permalink
Get full sensor status even if only subset has changed when composing…
Browse files Browse the repository at this point in the history
… SYS_STATUS message
  • Loading branch information
jdzerve committed Apr 4, 2019
1 parent d2a0c85 commit 4f59cf2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/modules/mavlink/mavlink_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,17 @@ class MavlinkStreamSysStatus : public MavlinkStream
const bool updated_battery = _battery_status_sub->update(&_battery_status_timestamp, &battery_status);

if (updated_status || updated_battery || updated_cpuload) {

if (!updated_status) {
_status_sub->update(&status);
}
if (!updated_battery) {
_battery_status_sub->update(&battery_status);
}
if (!updated_cpuload) {
_cpuload_sub->update(&cpuload);
}

mavlink_sys_status_t msg = {};

msg.onboard_control_sensors_present = status.onboard_control_sensors_present;
Expand Down

1 comment on commit 4f59cf2

@dagar
Copy link

@dagar dagar commented on 4f59cf2 Apr 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdzerve would you like to open a PR to get this in?

Please sign in to comment.