battery.hpp
Go to the documentation of this file.
1 
9 /*****************************************************************************
10 ** Ifdefs
11 *****************************************************************************/
12 
13 #ifndef KOBUKI_BATTERY_HPP_
14 #define KOBUKI_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 
28 namespace kobuki {
29 
30 /*****************************************************************************
31 ** Interfaces
32 *****************************************************************************/
33 
40 class kobuki_PUBLIC Battery {
41 public:
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_BATTERY_HPP_ */
kobuki::Battery::Level
Level
Definition: battery.hpp:61
kobuki
Definition: command.hpp:31
kobuki::Battery
Battery level module.
Definition: battery.hpp:46
kobuki_PUBLIC
#define kobuki_PUBLIC
Definition: macros.hpp:39
kobuki::Battery::State
State
Definition: battery.hpp:67
kobuki::Battery::Source
Source
Definition: battery.hpp:56


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Wed Mar 2 2022 00:26:14