#include <battery.hpp>
Public Types | |
enum | Level { Dangerous, Low, Healthy, Maximum } |
enum | Source { None, Adapter, Dock } |
enum | State { Discharging, Charged, Charging } |
Public Member Functions | |
Battery () | |
Battery (const uint8_t &new_voltage, const uint8_t &charger_flag) | |
Level | level () const |
float | percent () const |
Public Attributes | |
Source | charging_source |
State | charging_state |
double | voltage |
Static Public Attributes | |
static double | capacity = 16.5 |
static double | dangerous = 13.2 |
static double | low = 14.0 |
Battery level module.
Currently hard codes the battery status. It might be useful to provide some configurable parameters for this module in the future.
Definition at line 39 of file battery.hpp.
Definition at line 46 of file battery.hpp.
Definition at line 41 of file battery.hpp.
Definition at line 52 of file battery.hpp.
kobuki::Battery::Battery | ( | ) | [inline] |
Default constructor.
Definition at line 58 of file battery.hpp.
kobuki::Battery::Battery | ( | const uint8_t & | new_voltage, |
const uint8_t & | charger_flag | ||
) |
Configures the battery status given the current sensor readings.
new_voltage | : measured voltage*10 |
charger_flag | : bit flag representing charging status and source |
Definition at line 39 of file battery.cpp.
Battery::Level kobuki::Battery::level | ( | ) | const |
Definition at line 61 of file battery.cpp.
float kobuki::Battery::percent | ( | ) | const |
Definition at line 68 of file battery.cpp.
double kobuki::Battery::capacity = 16.5 [static] |
Definition at line 63 of file battery.hpp.
Definition at line 66 of file battery.hpp.
Definition at line 65 of file battery.hpp.
double kobuki::Battery::dangerous = 13.2 [static] |
Definition at line 63 of file battery.hpp.
double kobuki::Battery::low = 14.0 [static] |
Definition at line 63 of file battery.hpp.
double kobuki::Battery::voltage |
Definition at line 64 of file battery.hpp.