diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-25 12:55:13 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-25 12:55:13 +0200 |
commit | 7b06d781d8ade137a1837a3ecf002579bddfbb14 (patch) | |
tree | 64b404dbaf62e584d110659eb58a4d29576c58e5 /src/modules/mavlink/mavlink_messages.cpp | |
parent | 55b257eef36de69efdab33c53f0cb1b29b6496f3 (diff) | |
parent | c7ecafe99b6c6c567d9bd8ac223d5e20592644bc (diff) | |
download | px4-firmware-7b06d781d8ade137a1837a3ecf002579bddfbb14.tar.gz px4-firmware-7b06d781d8ade137a1837a3ecf002579bddfbb14.tar.bz2 px4-firmware-7b06d781d8ade137a1837a3ecf002579bddfbb14.zip |
Merge branch 'master' into beta
Diffstat (limited to 'src/modules/mavlink/mavlink_messages.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_messages.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/mavlink/mavlink_messages.cpp b/src/modules/mavlink/mavlink_messages.cpp index 5adfea36b..276035aa2 100644 --- a/src/modules/mavlink/mavlink_messages.cpp +++ b/src/modules/mavlink/mavlink_messages.cpp @@ -539,7 +539,8 @@ protected: msg.errors_count2 = status.errors_count2; msg.errors_count3 = status.errors_count3; msg.errors_count4 = status.errors_count4; - msg.battery_remaining = status.battery_remaining * 100.0f; + msg.battery_remaining = (msg.voltage_battery > 0) ? + status.battery_remaining * 100.0f : -1; _mavlink->send_message(MAVLINK_MSG_ID_SYS_STATUS, &msg); } |