commander: internalize system status bools

Most condition bools in the commander are not used anywhere but in the
commander. It therefore makes sense to move them to a different internal
struct and remove them from the vehicle_status message.

Also, the land_detected should be used by all the modules instead of
getting it through the commander and system_status.
This commit is contained in:
Julian Oes
2016-04-11 18:01:47 +02:00
parent 705979e3c7
commit 1f44fb1efd
18 changed files with 450 additions and 332 deletions
+6 -3
View File
@@ -574,12 +574,13 @@ protected:
struct vehicle_status_s status;
struct battery_status_s battery_status;
bool updated = _status_sub->update(&status);
updated = (updated || _battery_status_sub->update(&battery_status));
const bool updated_status = _status_sub->update(&status);
const bool updated_battery = _battery_status_sub->update(&battery_status);
if (updated) {
if (updated_status || updated_battery) {
mavlink_sys_status_t msg;
msg.onboard_control_sensors_present = status.onboard_control_sensors_present;
msg.onboard_control_sensors_enabled = status.onboard_control_sensors_enabled;
msg.onboard_control_sensors_health = status.onboard_control_sensors_health;
@@ -595,6 +596,8 @@ protected:
msg.errors_count3 = 0;
msg.errors_count4 = 0;
PX4_INFO("send sys status: voltage: %d", msg.voltage_battery);
_mavlink->send_message(MAVLINK_MSG_ID_SYS_STATUS, &msg);
/* battery status message with higher resolution */