Class BatteryModel

Inheritance Relationships

Derived Type

Class Documentation

class BatteryModel

Abstract base class for battery models.

This class defines the interface for different battery models to convert voltage readings to State of Charge (SOC) percentages.

Subclassed by ffw_robot_manager::UbetterBatteryModel

Public Functions

virtual ~BatteryModel() = default
virtual double voltage_to_soc(double voltage_v) const = 0

Convert voltage in Volts to SOC fraction.

Parameters:

voltage_v – Voltage in Volts

Returns:

SOC fraction (0.0 to 1.0)

virtual std::string get_model_name() const = 0

Get the battery model name.

Returns:

Model name string

virtual std::pair<double, double> get_voltage_range() const = 0

Get the voltage range for this battery model.

Returns:

Pair of (min_voltage_v, max_voltage_v)

virtual bool is_voltage_valid(double voltage_v) const = 0

Check if a voltage is within the valid range for this model.

Parameters:

voltage_v – Voltage in Volts

Returns:

True if voltage is within valid range

virtual uint8_t get_power_supply_technology() const = 0

Get the power supply technology for this battery model.

Returns:

Power supply technology constant (e.g., POWER_SUPPLY_TECHNOLOGY_LIPO)