YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IBattery.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_IBATTERY_H
7#define YARP_DEV_IBATTERY_H
8
9#include <string>
10
11#include <yarp/os/Vocab.h>
12#include <yarp/dev/api.h>
13
16
18namespace yarp::dev {
19class IBattery;
20}
21
28{
29public:
31 {
32 BATTERY_OK_STANDBY = 0,
33 BATTERY_OK_IN_CHARGE = 1,
34 BATTERY_OK_IN_USE = 2,
35 BATTERY_GENERAL_ERROR = 3,
37 BATTERY_LOW_WARNING = 5,
38 BATTERY_CRITICAL_WARNING = 6
39 };
40
41 virtual ~IBattery();
42
48 virtual bool getBatteryVoltage(double &voltage) = 0;
49
55 virtual bool getBatteryCurrent(double &current) = 0;
56
62 virtual bool getBatteryCharge(double &charge) = 0;
63
69 virtual bool getBatteryStatus(Battery_status &status) = 0;
70
76 virtual bool getBatteryTemperature(double &temperature) = 0;
77
83 virtual bool getBatteryInfo(std::string &battery_info) = 0;
84};
85
86#endif // YARP_DEV_IBATTERY_H
constexpr yarp::conf::vocab32_t VOCAB_IBATTERY
Definition IBattery.h:14
constexpr yarp::conf::vocab32_t VOCAB_BATTERY_INFO
Definition IBattery.h:15
const int BATTERY_TIMEOUT
A generic battery interface.
Definition IBattery.h:28
virtual bool getBatteryCurrent(double &current)=0
Get the instantaneous current measurement.
virtual bool getBatteryVoltage(double &voltage)=0
Get the instantaneous voltage measurement.
virtual bool getBatteryInfo(std::string &battery_info)=0
get the battery hardware characteristics (e.g.
virtual bool getBatteryStatus(Battery_status &status)=0
get the battery status
virtual bool getBatteryCharge(double &charge)=0
get the battery status of charge
virtual bool getBatteryTemperature(double &temperature)=0
get the battery temperature
std::int32_t vocab32_t
Definition numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition Vocab.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18