Commander: bugfix: get all available messages on the subsystem_info topic

This commit is contained in:
Dusan Zivkovic
2019-10-10 13:12:31 +02:00
committed by Beat Küng
parent b6f21fa76e
commit ab2e235333
+5 -10
View File
@@ -1289,8 +1289,6 @@ Commander::run()
bool status_changed = true; bool status_changed = true;
bool param_init_forced = true; bool param_init_forced = true;
bool updated = false;
uORB::Subscription actuator_controls_sub{ORB_ID_VEHICLE_ATTITUDE_CONTROLS}; uORB::Subscription actuator_controls_sub{ORB_ID_VEHICLE_ATTITUDE_CONTROLS};
uORB::Subscription cmd_sub{ORB_ID(vehicle_command)}; uORB::Subscription cmd_sub{ORB_ID(vehicle_command)};
uORB::Subscription cpuload_sub{ORB_ID(cpuload)}; uORB::Subscription cpuload_sub{ORB_ID(cpuload)};
@@ -1736,14 +1734,11 @@ Commander::run()
battery_status_check(); battery_status_check();
/* update subsystem info which arrives from outside of commander*/ /* update subsystem info which arrives from outside of commander*/
do { subsystem_info_s info;
if (subsys_sub.updated()) { while (subsys_sub.update(&info)) {
subsystem_info_s info{}; set_health_flags(info.subsystem_type, info.present, info.enabled, info.ok, status);
subsys_sub.copy(&info); status_changed = true;
set_health_flags(info.subsystem_type, info.present, info.enabled, info.ok, status); }
status_changed = true;
}
} while (updated);
/* If in INIT state, try to proceed to STANDBY state */ /* If in INIT state, try to proceed to STANDBY state */
if (!status_flags.condition_calibration_enabled && status.arming_state == vehicle_status_s::ARMING_STATE_INIT) { if (!status_flags.condition_calibration_enabled && status.arming_state == vehicle_status_s::ARMING_STATE_INIT) {