diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-03-03 21:19:56 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-03-03 21:19:56 +0400 |
commit | 3674aae4a746099a162cbf943311b587cd46822f (patch) | |
tree | 5a5f9dbb21b61ac1afa34599adddcd961b92eacf | |
parent | eb32c7198e60c430d43150f5a1975a5914b25736 (diff) | |
download | px4-firmware-3674aae4a746099a162cbf943311b587cd46822f.tar.gz px4-firmware-3674aae4a746099a162cbf943311b587cd46822f.tar.bz2 px4-firmware-3674aae4a746099a162cbf943311b587cd46822f.zip |
commander: ignore battery voltage in HIL mode
-rw-r--r-- | src/modules/commander/commander.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index d5af63120..483437029 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -962,7 +962,7 @@ int commander_thread_main(int argc, char *argv[]) orb_copy(ORB_ID(battery_status), battery_sub, &battery); /* only consider battery voltage if system has been running 2s and battery voltage is valid */ - if (hrt_absolute_time() > start_time + 2000000 && battery.voltage_filtered_v > 0.0f) { + if (status.hil_state == HIL_STATE_OFF && hrt_absolute_time() > start_time + 2000000 && battery.voltage_filtered_v > 0.0f) { status.battery_voltage = battery.voltage_filtered_v; status.battery_current = battery.current_a; status.condition_battery_voltage_valid = true; |