diff options
author | unknown <marco@notebook.(none)> | 2013-01-08 20:37:47 +0100 |
---|---|---|
committer | unknown <marco@notebook.(none)> | 2013-01-08 20:37:47 +0100 |
commit | 1998ce120514b808f4b8b5256302e05001b4e33c (patch) | |
tree | 1d33afd95a46850b18cc0fef025751ce9fd9a380 /apps/commander/commander.c | |
parent | 01ea8eb54f1838122ce4c938beb7b4452e89c2fe (diff) | |
download | px4-firmware-1998ce120514b808f4b8b5256302e05001b4e33c.tar.gz px4-firmware-1998ce120514b808f4b8b5256302e05001b4e33c.tar.bz2 px4-firmware-1998ce120514b808f4b8b5256302e05001b4e33c.zip |
Battery-Warn-State added to struct Vehicle_Status
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r-- | apps/commander/commander.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 17087ab8a..986266843 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1200,6 +1200,7 @@ int commander_thread_main(int argc, char *argv[]) /* mark all signals lost as long as they haven't been found */ current_status.rc_signal_lost = true; current_status.offboard_control_signal_lost = true; + current_status.battery_warning = VEHICLE_BATTERY_WARNING_NONE; /* advertise to ORB */ stat_pub = orb_advertise(ORB_ID(vehicle_status), ¤t_status); @@ -1393,6 +1394,7 @@ int commander_thread_main(int argc, char *argv[]) if (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT) { low_battery_voltage_actions_done = true; + current_status.battery_warning = VEHICLE_BATTERY_WARNING_WARNING; mavlink_log_critical(mavlink_fd, "[commander] WARNING! LOW BATTERY!"); } @@ -1403,6 +1405,7 @@ int commander_thread_main(int argc, char *argv[]) else if (battery_voltage_valid && (bat_remain < 0.1f /* XXX MAGIC NUMBER */) && (false == critical_battery_voltage_actions_done && true == low_battery_voltage_actions_done)) { if (critical_voltage_counter > CRITICAL_VOLTAGE_BATTERY_COUNTER_LIMIT) { critical_battery_voltage_actions_done = true; + current_status.battery_warning = VEHICLE_BATTERY_WARNING_ALERT; mavlink_log_critical(mavlink_fd, "[commander] EMERGENCY! CRITICAL BATTERY!"); state_machine_emergency(stat_pub, ¤t_status, mavlink_fd); } |