Skip to content

Commit 003f6ac

Browse files
committed
SITL: fix EvaluateBatteryModel example
1 parent e0f8469 commit 003f6ac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/SITL/examples/EvaluateBatteryModel/EvaluateBatteryModel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ void setup(void)
6262

6363
// setup battery model
6464
battery.setup(amp_hour_capacity, resistance, max_voltage);
65-
battery.init_voltage(max_voltage);
6665

6766
uint64_t time = 0;
6867
hal.scheduler->stop_clock(time);
6968
const double time_step = 0.05;
7069

7170
::printf("time, voltage\n");
7271
while (battery.get_voltage() >= min_voltage) {
73-
battery.set_current(current);
72+
battery.consume_energy(current);
7473

7574
::printf("%0.2f, %0.2f\n", time * 1.0e-6, battery.get_voltage());
7675

0 commit comments

Comments
 (0)