Kobuki 1.0.0
C++ API for the Kobuki research robot
Loading...
Searching...
No Matches
kobuki::Battery Class Reference

Battery level module. More...

#include <battery.hpp>

Public Types

enum  Source { None , Adapter , Dock }
 
enum  Level { Dangerous , Low , Healthy , Maximum }
 
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

double voltage
 
State charging_state
 
Source charging_source
 

Static Public Attributes

static double capacity = 16.5
 
static double low = 14.0
 
static double dangerous = 13.2
 

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.

Constructor & Destructor Documentation

◆ Battery() [1/2]

kobuki::Battery::Battery ( )
inline

Default constructor.

◆ Battery() [2/2]

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

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