MIRA
Public Attributes | List of all members
BatteryState Class Reference

A class for holding the current battery state. More...

#include <robot/BatteryState.h>

Public Member Functions

Constructors and reflect
 BatteryState ()
 The constructor. More...
 
 BatteryState (float iVoltage, float iCurrent, uint8 iPercent, int16 iTime, bool iCharging, bool iPowerSupplyPresent)
 Construct a new battery state object with specified parameters. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 

Public Attributes

float voltage
 The battery voltage in [V]. More...
 
float current
 The battery current in [A]. More...
 
uint8 lifePercent
 The battery life percent [0..100] or 255 if unknown. More...
 
int16 lifeTime
 The battery life time in minutes or -1 if unknown. More...
 
bool charging
 Is the battery currently being charged. More...
 
bool powerSupplyPresent
 Is the robot powered by an external power supply. More...
 
std::vector< float > cellVoltage
 The voltage of the single battery cells in [V]. More...
 

Detailed Description

A class for holding the current battery state.

The battery state is described by the current voltage, the battery current, the charge state in percent, an estimated life time in minutes and a flag, which indicates if the battery is currently charged or not.

The battery life percent and battery life time are optional values.

Constructor & Destructor Documentation

◆ BatteryState() [1/2]

BatteryState ( )
inline

The constructor.

◆ BatteryState() [2/2]

BatteryState ( float  iVoltage,
float  iCurrent,
uint8  iPercent,
int16  iTime,
bool  iCharging,
bool  iPowerSupplyPresent 
)
inline

Construct a new battery state object with specified parameters.

Parameters
[in]iVoltageThe current voltage in [V].
[in]iCurrentThe current current in [A].
[in]iPercentThe current battery capacity in [%] (255 if unknown).
[in]iTimeThe estimated life time in minutes (-1 if unknown).
[in]iChargingCharging flag.
[in]iPowerSupplyPresentExternal power supply connected flag.

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

Member Data Documentation

◆ voltage

float voltage

The battery voltage in [V].

◆ current

float current

The battery current in [A].

◆ lifePercent

uint8 lifePercent

The battery life percent [0..100] or 255 if unknown.

◆ lifeTime

int16 lifeTime

The battery life time in minutes or -1 if unknown.

◆ charging

bool charging

Is the battery currently being charged.

◆ powerSupplyPresent

bool powerSupplyPresent

Is the robot powered by an external power supply.

◆ cellVoltage

std::vector<float> cellVoltage

The voltage of the single battery cells in [V].


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