4#include "wpi/sendable/Sendable.h"
5#include "wpi/sendable/SendableHelper.h"
6#include "wpi/sendable/SendableBuilder.h"
7#include "BattFuelGaugeApi.h"
10class BattFuelGaugeImpl;
24class BattFuelGauge :
public wpi::Sendable,
public wpi::SendableHelper<BattFuelGauge> {
93 void InitSendable(wpi::SendableBuilder& builder)
override;
130 void SaveLog(std::string filename =
"");
416 BattFuelGauge_t *m_handle;
float GetVoltage() const
Get the current battery voltage.
Definition BattFuelGauge.cpp:71
uint32_t GetSerialNumber() const
Definition BattFuelGauge.cpp:50
float GetMatchStartingEnergy() const
Energy stored at the beginning of the last robot match.
Definition BattFuelGauge.cpp:228
float GetCycleMaxCurrent() const
Maximum charging current observed during the last charge cycle.
Definition BattFuelGauge.cpp:140
void SaveLog(std::string filename="")
Get the battery charge/discharge state.
Definition BattFuelGauge.cpp:55
float GetMatchChargeTime() const
Total charging time during the last robot match (if any).
Definition BattFuelGauge.cpp:216
float GetCycleMaxDodAh() const
Maximum depth of discharge reached during the last charge cycle.
Definition BattFuelGauge.cpp:160
float GetCycleChargeTime() const
Total time spent charging during the last charge cycle.
Definition BattFuelGauge.cpp:172
float GetCycleStartingVoltage() const
Starting voltage at the beginning of the last charge cycle.
Definition BattFuelGauge.cpp:180
BattFuelGauge(const BattFuelGauge &)=delete
float GetMatchMinVoltage() const
Minimum voltage observed during the last robot match.
Definition BattFuelGauge.cpp:200
float GetEffectiveCapacityAh() const
Get the effective (usable) capacity of the battery.
Definition BattFuelGauge.cpp:87
BattMfg GetManufacturer() const
Get the battery manufacturer identifier.
Definition BattFuelGauge.cpp:120
float GetCycleMaxVoltage() const
Maximum voltage observed during the last charge cycle.
Definition BattFuelGauge.cpp:152
float GetMatchMaxDodAh() const
Maximum depth of discharge reached during the last robot match.
Definition BattFuelGauge.cpp:212
float GetMatchMinCurrent() const
Minimum current (most negative discharge) during the last match.
Definition BattFuelGauge.cpp:196
float GetMatchMinDodAh() const
Minimum depth of discharge reached during the last robot match.
Definition BattFuelGauge.cpp:208
bool IsConnected() const
Definition BattFuelGauge.cpp:248
float GetBatteryAgeDays() const
Get the age of the battery.
Definition BattFuelGauge.cpp:95
float GetDodWh() const
Get the current depth of discharge energy.
Definition BattFuelGauge.cpp:79
float GetMatchMaxCurrent() const
Maximum current (any direction) during the last robot match.
Definition BattFuelGauge.cpp:192
BattFuelGauge(BattFuelGauge &&)=default
float GetMatchStartingVoltage() const
Battery voltage at the start of the last robot match.
Definition BattFuelGauge.cpp:224
float GetCycleMinDodAh() const
Minimum depth of discharge reached during the last charge cycle.
Definition BattFuelGauge.cpp:156
float GetMatchMaxVoltage() const
Maximum voltage observed during the last robot match.
Definition BattFuelGauge.cpp:204
float GetMatchStartingCharge() const
Charge stored at the beginning of the last robot match.
Definition BattFuelGauge.cpp:236
float GetCycleRmsDischargeCurrent() const
RMS discharge current during the last complete charge cycle.
Definition BattFuelGauge.cpp:136
float GetCurrent() const
Get the battery discharge current.
Definition BattFuelGauge.cpp:67
float GetMatchDuration() const
Duration of the last robot match.
Definition BattFuelGauge.cpp:244
float GetCapacityAh() const
Get the current (estimated) battery capacity.
Definition BattFuelGauge.cpp:99
BattFuelGauge & operator=(BattFuelGauge &&)=default
float GetCycleDischargeTime() const
Total time spent discharging during the last charge cycle.
Definition BattFuelGauge.cpp:176
float GetCycleMinDodWh() const
Minimum energy discharged during the last charge cycle.
Definition BattFuelGauge.cpp:164
uint32_t GetFirmwareVersion() const
Definition BattFuelGauge.cpp:46
float GetRemainingChargePct() const
Get the remaining charge as a percentage.
Definition BattFuelGauge.cpp:83
BattFuelGauge & operator=(const BattFuelGauge &)=delete
int GetNumCycles() const
Get the total number of charge/discharge cycles.
Definition BattFuelGauge.cpp:107
float GetCycleMinCurrent() const
Maximum discharge current observed during the last charge cycle.
Definition BattFuelGauge.cpp:144
ChargeState GetBatteryState() const
Get the battery charge/discharge state.
Definition BattFuelGauge.cpp:63
virtual ~BattFuelGauge()
Definition BattFuelGauge.cpp:21
float GetCycleMaxDodWh() const
Maximum energy discharged during the last charge cycle.
Definition BattFuelGauge.cpp:168
float GetMatchEndingEnergy() const
Energy remaining at the end of the last robot match.
Definition BattFuelGauge.cpp:232
float GetMatchRmsDischargeCurrent() const
RMS discharge current during the last robot match.
Definition BattFuelGauge.cpp:188
BattMfg
Definition BattFuelGauge.h:71
@ kDuracell
Definition BattFuelGauge.h:72
@ kPowerSonic
Definition BattFuelGauge.h:77
@ kMKPowered
Definition BattFuelGauge.h:76
@ kMightyMax
Definition BattFuelGauge.h:75
@ kInterstate
Definition BattFuelGauge.h:74
@ kEnergizer
Definition BattFuelGauge.h:73
@ kNumMfgs
Definition BattFuelGauge.h:78
void InitSendable(wpi::SendableBuilder &builder) override
Definition BattFuelGauge.cpp:28
void IdentifySensor()
Definition BattFuelGauge.cpp:42
void SetManufacturer(BattMfg newMfg) const
Set the battery manufacturer.
Definition BattFuelGauge.cpp:128
std::string GetNickname() const
Get the user-defined nickname of the battery.
Definition BattFuelGauge.cpp:115
float GetDodAh() const
Get the current depth of discharge in ampere-hours.
Definition BattFuelGauge.cpp:75
float GetMatchEndingCharge() const
Charge remaining at the end of the last robot match.
Definition BattFuelGauge.cpp:240
float GetRatedCapacityAh() const
Get the original rated capacity when the battery was new.
Definition BattFuelGauge.cpp:103
ChargeState
Definition BattFuelGauge.h:30
@ kConstVCharge
Definition BattFuelGauge.h:49
@ kDischarge
Definition BattFuelGauge.h:39
@ kTrickleCharge
Definition BattFuelGauge.h:54
@ kIdle
Definition BattFuelGauge.h:59
@ kConstICharge
Definition BattFuelGauge.h:44
@ kMeasureOCV
Definition BattFuelGauge.h:64
@ kInit
Definition BattFuelGauge.h:34
float GetMatchDischargeTime() const
Total discharging time during the last robot match.
Definition BattFuelGauge.cpp:220
BattFuelGauge(uint8_t sensorID)
Definition BattFuelGauge.cpp:14
float GetCycleMinVoltage() const
Minimum voltage observed during the last charge cycle.
Definition BattFuelGauge.cpp:148
void SetNickname(std::string newNickname) const
Set the user-defined nickname of the battery.
Definition BattFuelGauge.cpp:124
Definition BattFuelGauge.h:9