Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
kobuki::Battery Class Reference

Battery level module. More...

#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
 

Detailed Description

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 40 of file battery.hpp.

Member Enumeration Documentation

Enumerator
Dangerous 
Low 
Healthy 
Maximum 

Definition at line 47 of file battery.hpp.

Enumerator
None 
Adapter 
Dock 

Definition at line 42 of file battery.hpp.

Enumerator
Discharging 
Charged 
Charging 

Definition at line 53 of file battery.hpp.

Constructor & Destructor Documentation

kobuki::Battery::Battery ( )
inline

Default constructor.

Definition at line 59 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.

Parameters
new_voltage: measured voltage*10
charger_flag: bit flag representing charging status and source

Definition at line 39 of file battery.cpp.

Member Function Documentation

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.

Member Data Documentation

double kobuki::Battery::capacity = 16.5
static

Definition at line 64 of file battery.hpp.

Source kobuki::Battery::charging_source

Definition at line 69 of file battery.hpp.

State kobuki::Battery::charging_state

Definition at line 68 of file battery.hpp.

double kobuki::Battery::dangerous = 13.2
static

Definition at line 66 of file battery.hpp.

double kobuki::Battery::low = 14.0
static

Definition at line 65 of file battery.hpp.

double kobuki::Battery::voltage

Definition at line 67 of file battery.hpp.


The documentation for this class was generated from the following files:


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Fri Sep 18 2020 03:22:02