YARP
Yet Another Robot Platform
yarp::dev::IBattery Class Referenceabstract

A generic battery interface. More...

#include <yarp/dev/IBattery.h>

+ Inheritance diagram for yarp::dev::IBattery:

Public Types

enum  Battery_status {
  BATTERY_OK_STANBY = 0,
  BATTERY_OK_IN_CHARGE = 1,
  BATTERY_OK_IN_USE = 2,
  BATTERY_GENERAL_ERROR = 3,
  BATTERY_TIMEOUT = 4,
  BATTERY_LOW_WARNING = 5,
  BATTERY_CRITICAL_WARNING = 6
}
 

Public Member Functions

virtual ~IBattery ()
 
virtual bool getBatteryVoltage (double &voltage)=0
 Get the instantaneous voltage measurement. More...
 
virtual bool getBatteryCurrent (double &current)=0
 Get the instantaneous current measurement. More...
 
virtual bool getBatteryCharge (double &charge)=0
 get the battery status of charge More...
 
virtual bool getBatteryStatus (Battery_status &status)=0
 get the battery status More...
 
virtual bool getBatteryTemperature (double &temperature)=0
 get the battery temperature More...
 
virtual bool getBatteryInfo (std::string &battery_info)=0
 get the battery hardware characteristics (e.g. More...
 

Detailed Description

A generic battery interface.

Definition at line 32 of file IBattery.h.

Member Enumeration Documentation

◆ Battery_status

Enumerator
BATTERY_OK_STANBY 
BATTERY_OK_IN_CHARGE 
BATTERY_OK_IN_USE 
BATTERY_GENERAL_ERROR 
BATTERY_TIMEOUT 
BATTERY_LOW_WARNING 
BATTERY_CRITICAL_WARNING 

Definition at line 35 of file IBattery.h.

Constructor & Destructor Documentation

◆ ~IBattery()

yarp::dev::IBattery::~IBattery ( )
virtualdefault

Member Function Documentation

◆ getBatteryCharge()

virtual bool yarp::dev::IBattery::getBatteryCharge ( double &  charge)
pure virtual

get the battery status of charge

Parameters
chargethe charge measurement (0-100%)
Returns
true/false.

Implemented in UpowerBattery, FakeBattery, and BatteryClient.

◆ getBatteryCurrent()

virtual bool yarp::dev::IBattery::getBatteryCurrent ( double &  current)
pure virtual

Get the instantaneous current measurement.

Parameters
currentthe current measurement
Returns
true/false.

Implemented in UpowerBattery, FakeBattery, and BatteryClient.

◆ getBatteryInfo()

virtual bool yarp::dev::IBattery::getBatteryInfo ( std::string &  battery_info)
pure virtual

get the battery hardware characteristics (e.g.

max voltage etc)

Parameters
astring containing the battery infos
Returns
true/false.

Implemented in UpowerBattery, FakeBattery, and BatteryClient.

◆ getBatteryStatus()

virtual bool yarp::dev::IBattery::getBatteryStatus ( Battery_status status)
pure virtual

get the battery status

Parameters
statusthe battery status
Returns
true/false.

Implemented in UpowerBattery, FakeBattery, and BatteryClient.

◆ getBatteryTemperature()

virtual bool yarp::dev::IBattery::getBatteryTemperature ( double &  temperature)
pure virtual

get the battery temperature

Parameters
temperaturethe battery temperature
Returns
true/false.

Implemented in UpowerBattery, FakeBattery, and BatteryClient.

◆ getBatteryVoltage()

virtual bool yarp::dev::IBattery::getBatteryVoltage ( double &  voltage)
pure virtual

Get the instantaneous voltage measurement.

Parameters
voltagethe voltage measurement
Returns
true/false.

Implemented in UpowerBattery, FakeBattery, and BatteryClient.


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