#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 (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 46 of file battery.hpp.
Enumerator | |
---|---|
Dangerous | |
Low | |
Healthy | |
Maximum |
Definition at line 61 of file battery.hpp.
Enumerator | |
---|---|
None | |
Adapter | |
Dock |
Definition at line 56 of file battery.hpp.
Enumerator | |
---|---|
Discharging | |
Charged | |
Charging |
Definition at line 67 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 43 of file battery.cpp.
Battery::Level kobuki::Battery::level | ( | ) | const |
Definition at line 65 of file battery.cpp.
float kobuki::Battery::percent | ( | ) | const |
Definition at line 72 of file battery.cpp.
|
static |
Definition at line 78 of file battery.hpp.
Source kobuki::Battery::charging_source |
Definition at line 83 of file battery.hpp.
State kobuki::Battery::charging_state |
Definition at line 82 of file battery.hpp.
|
static |
Definition at line 80 of file battery.hpp.
|
static |
Definition at line 79 of file battery.hpp.
double kobuki::Battery::voltage |
Definition at line 81 of file battery.hpp.