Kobuki 1.0.0
C++ API for the Kobuki research robot
Loading...
Searching...
No Matches
battery.hpp
1
9/*****************************************************************************
10** Ifdefs
11*****************************************************************************/
12
13#ifndef KOBUKI_CORE_BATTERY_HPP_
14#define KOBUKI_CORE_BATTERY_HPP_
15
16/*****************************************************************************
17** Includes
18*****************************************************************************/
19
20#include <stdint.h>
21#include "../packets/core_sensors.hpp"
22#include "../macros.hpp"
23
24/*****************************************************************************
25** Namespaces
26*****************************************************************************/
27
28namespace kobuki {
29
30/*****************************************************************************
31** Interfaces
32*****************************************************************************/
33
40class kobuki_PUBLIC Battery {
41public:
42 enum Source {
43 None,
44 Adapter,
45 Dock
46 };
47 enum Level {
48 Dangerous,
49 Low,
50 Healthy,
51 Maximum
52 };
53 enum State {
54 Discharging,
55 Charged,
56 Charging
57 };
58
59 Battery() {}
60 Battery (const uint8_t &new_voltage, const uint8_t &charger_flag);
61 Level level() const;
62 float percent() const;
63
64 static double capacity;
65 static double low;
66 static double dangerous;
67 double voltage;
68 State charging_state;
69 Source charging_source;
70};
71
72} // namespace kobuki
73
74#endif /* KOBUKI_CORE_BATTERY_HPP_ */
Battery level module.
Definition battery.hpp:40
Battery()
Definition battery.hpp:59