From 7d2589869455e83563fdc66452eba6a34789b243 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 13 Nov 2019 19:27:13 +0300 Subject: [PATCH] =?UTF-8?q?led:=20don=E2=80=99t=20indicate=20low=20voltage?= =?UTF-8?q?=20lower=20than=202.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clever/src/led.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clever/src/led.cpp b/clever/src/led.cpp index e72354d3..dd2f31a4 100644 --- a/clever/src/led.cpp +++ b/clever/src/led.cpp @@ -278,7 +278,8 @@ void handleLog(const rosgraph_msgs::Log& log) void handleBattery(const sensor_msgs::BatteryState& msg) { for (auto const& voltage : msg.cell_voltage) { - if (voltage < low_battery_threshold) { + if (voltage < low_battery_threshold && + voltage > 2.0) { // voltage < 2.0 likely indicates incorrect voltage measurement // notify low battery every time notify("low_battery"); }