MCPcopy Create free account
hub / github.com/CopterExpress/clover / handleBattery

Function handleBattery

clover/src/led.cpp:286–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286void handleBattery(const sensor_msgs::BatteryState& msg)
287{
288 for (auto const& voltage : msg.cell_voltage) {
289 if (voltage < low_battery_threshold &&
290 voltage > 2.0) { // voltage < 2.0 likely indicates incorrect voltage measurement
291 // notify low battery every time
292 notify("low_battery");
293 }
294 }
295}
296
297int main(int argc, char **argv)
298{

Callers

nothing calls this directly

Calls 1

notifyFunction · 0.70

Tested by

no test coverage detected