47 double tmpDT=now-prev;
49 if (
tmpDT > deltaTMax) {
52 if (
tmpDT < deltaTMin) {
57 if (
tmpDT*1000<BATTERY_TIMEOUT)
111 double voltage = lastData.
voltage;
119 double current = lastData.
current;
127 double charge = lastData.
charge;
268 battery_info =
ret.info;
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue getBatteryVoltage(double &voltage) override
Get the instantaneous voltage measurement.
yarp::os::Stamp getLastInputStamp() override
Get the time stamp for the last read data.
IBatteryMsgs m_battery_RPC
Battery_InputPortProcessor inputPort
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 getBatteryTemperature(double &temperature) override
get the battery temperature
yarp::dev::ReturnValue getBatteryInfo(std::string &battery_info) override
get the battery hardware characteristics (e.g.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue getBatteryCurrent(double ¤t) override
Get the instantaneous current measurement.
virtual return_get_BatteryInfo getBatteryInfoRPC()
double charge
Battery charge percentage [%].
double voltage
Battery Voltage [V].
double current
Battery Current [A].
std::int32_t status
the status of the device.
double temperature
Battery Temperature [degC].
A mini-server for performing network communication in the background.
bool getEnvelope(PortReader &envelope) override
void close() override
Stop port activity.
BufferedPort()
Constructor.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A base class for nested structures that can be searched.
An abstraction for a time stamp and/or sequence number.
double getTime() const
Get the time stamp.
bool isValid() const
Check if this Stamp is valid.
bool attachAsClient(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a client, sending data via the specified port.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
An interface to the operating system, including Port based communication.