33 static units::volt_t
Calculate(units::volt_t nominalVoltage,
34 units::ohm_t resistance,
35 std::span<const units::ampere_t> currents) {
36 return nominalVoltage -
37 std::accumulate(currents.begin(), currents.end(), 0_A) * resistance;
53 units::volt_t nominalVoltage, units::ohm_t resistance,
54 std::initializer_list<units::ampere_t> currents) {
55 return nominalVoltage -
56 std::accumulate(currents.begin(), currents.end(), 0_A) * resistance;
69 static units::volt_t
Calculate(std::span<const units::ampere_t> currents) {
70 return Calculate(12_V, 0.02_Ohm, currents);
84 std::initializer_list<units::ampere_t> currents) {
85 return Calculate(12_V, 0.02_Ohm, currents);
A utility class to simulate the robot battery.
Definition: BatterySim.h:19
static units::volt_t Calculate(units::volt_t nominalVoltage, units::ohm_t resistance, std::initializer_list< units::ampere_t > currents)
Calculate the loaded battery voltage.
Definition: BatterySim.h:52
static units::volt_t Calculate(std::initializer_list< units::ampere_t > currents)
Calculate the loaded battery voltage.
Definition: BatterySim.h:83
static units::volt_t Calculate(units::volt_t nominalVoltage, units::ohm_t resistance, std::span< const units::ampere_t > currents)
Calculate the loaded battery voltage.
Definition: BatterySim.h:33
static units::volt_t Calculate(std::span< const units::ampere_t > currents)
Calculate the loaded battery voltage.
Definition: BatterySim.h:69
Definition: BatterySim.h:14