YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

Battery_nwc_yarp: The client side of any IBattery capable device. More...

#include <networkWrappers/battery_nwc_yarp/Battery_nwc_yarp.h>

+ Inheritance diagram for Battery_nwc_yarp:

Public Member Functions

bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
yarp::os::Stamp getLastInputStamp () override
 Get the time stamp for the last read data.
 
yarp::dev::ReturnValue getBatteryVoltage (double &voltage) override
 Get the instantaneous voltage measurement.
 
yarp::dev::ReturnValue getBatteryCurrent (double &current) override
 Get the instantaneous current measurement.
 
yarp::dev::ReturnValue getBatteryCharge (double &charge) override
 get the battery status of charge
 
yarp::dev::ReturnValue getBatteryStatus (yarp::dev::IBattery::Battery_status &status) override
 get the battery status
 
yarp::dev::ReturnValue getBatteryInfo (std::string &battery_info) override
 get the battery hardware characteristics (e.g.
 
yarp::dev::ReturnValue getBatteryTemperature (double &temperature) override
 get the battery temperature
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::IPreciselyTimed
virtual ~IPreciselyTimed ()
 
- Public Member Functions inherited from yarp::dev::IBattery
virtual ~IBattery ()
 
- Public Member Functions inherited from Battery_nwc_yarp_ParamsParser
 Battery_nwc_yarp_ParamsParser ()
 
 ~Battery_nwc_yarp_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Protected Attributes

Battery_InputPortProcessor inputPort
 
yarp::os::Port rpcPort
 
IBatteryMsgs m_battery_RPC
 
yarp::os::Stamp lastTs
 
std::string deviceId
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IBattery
enum  Battery_status {
  BATTERY_OK_STANDBY = 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 Attributes inherited from Battery_nwc_yarp_ParamsParser
const std::string m_device_classname = {"Battery_nwc_yarp"}
 
const std::string m_device_name = {"battery_nwc_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_local_defaultValue = {""}
 
const std::string m_remote_defaultValue = {""}
 
const std::string m_carrier_defaultValue = {"tcp"}
 
std::string m_local = {}
 
std::string m_remote = {}
 
std::string m_carrier = {"tcp"}
 

Detailed Description

Battery_nwc_yarp: The client side of any IBattery capable device.

Parameters required by this device are shown in class: Battery_nwc_yarp_ParamsParser

Definition at line 75 of file Battery_nwc_yarp.h.

Member Function Documentation

◆ close()

bool Battery_nwc_yarp::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 223 of file Battery_nwc_yarp.cpp.

◆ getBatteryCharge()

ReturnValue Battery_nwc_yarp::getBatteryCharge ( double charge)
overridevirtual

get the battery status of charge

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

Implements yarp::dev::IBattery.

Definition at line 242 of file Battery_nwc_yarp.cpp.

◆ getBatteryCurrent()

ReturnValue Battery_nwc_yarp::getBatteryCurrent ( double current)
overridevirtual

Get the instantaneous current measurement.

Parameters
currentthe current measurement
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 236 of file Battery_nwc_yarp.cpp.

◆ getBatteryInfo()

ReturnValue Battery_nwc_yarp::getBatteryInfo ( std::string &  battery_info)
overridevirtual

get the battery hardware characteristics (e.g.

max voltage etc)

Parameters
astring containing the battery infos
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 260 of file Battery_nwc_yarp.cpp.

◆ getBatteryStatus()

ReturnValue Battery_nwc_yarp::getBatteryStatus ( yarp::dev::IBattery::Battery_status status)
overridevirtual

get the battery status

Parameters
statusthe battery status
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 248 of file Battery_nwc_yarp.cpp.

◆ getBatteryTemperature()

ReturnValue Battery_nwc_yarp::getBatteryTemperature ( double temperature)
overridevirtual

get the battery temperature

Parameters
temperaturethe battery temperature
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 254 of file Battery_nwc_yarp.cpp.

◆ getBatteryVoltage()

ReturnValue Battery_nwc_yarp::getBatteryVoltage ( double voltage)
overridevirtual

Get the instantaneous voltage measurement.

Parameters
voltagethe voltage measurement
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 230 of file Battery_nwc_yarp.cpp.

◆ getLastInputStamp()

Stamp Battery_nwc_yarp::getLastInputStamp ( )
overridevirtual

Get the time stamp for the last read data.

Returns
last time stamp.

Implements yarp::dev::IPreciselyTimed.

Definition at line 272 of file Battery_nwc_yarp.cpp.

◆ open()

bool Battery_nwc_yarp::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 175 of file Battery_nwc_yarp.cpp.

Member Data Documentation

◆ deviceId

std::string Battery_nwc_yarp::deviceId
protected

Definition at line 86 of file Battery_nwc_yarp.h.

◆ inputPort

Battery_InputPortProcessor Battery_nwc_yarp::inputPort
protected

Definition at line 82 of file Battery_nwc_yarp.h.

◆ lastTs

yarp::os::Stamp Battery_nwc_yarp::lastTs
protected

Definition at line 85 of file Battery_nwc_yarp.h.

◆ m_battery_RPC

IBatteryMsgs Battery_nwc_yarp::m_battery_RPC
protected

Definition at line 84 of file Battery_nwc_yarp.h.

◆ rpcPort

yarp::os::Port Battery_nwc_yarp::rpcPort
protected

Definition at line 83 of file Battery_nwc_yarp.h.


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