Go to the documentation of this file.00001
00009
00010
00011
00012
00013 #ifndef KOBUKI_BATTERY_HPP_
00014 #define KOBUKI_BATTERY_HPP_
00015
00016
00017
00018
00019
00020 #include <stdint.h>
00021 #include "../packets/core_sensors.hpp"
00022
00023
00024
00025
00026
00027 namespace kobuki {
00028
00029
00030
00031
00032
00039 class Battery {
00040 public:
00041 enum Source {
00042 None,
00043 Adapter,
00044 Dock
00045 };
00046 enum Level {
00047 Dangerous,
00048 Low,
00049 Healthy,
00050 Maximum
00051 };
00052 enum State {
00053 Discharging,
00054 Charged,
00055 Charging
00056 };
00057
00058 Battery() {}
00059 Battery (const uint8_t &new_voltage, const uint8_t &charger_flag);
00060 Level level() const;
00061 float percent() const;
00062
00063 static double capacity, low, dangerous;
00064 double voltage;
00065 State charging_state;
00066 Source charging_source;
00067 };
00068
00069 }
00070
00071 #endif