fix(battery_simulator): remove constraining again

now that SIM_BAT_DRAIN=0 means the module is not started we are safe
from division by zero again (param compare has a tolerance of 1e-7)
This commit is contained in:
Balduin 2026-04-09 09:05:21 +02:00
parent da9d8342db
commit 6380c4fdee

View File

@ -85,8 +85,7 @@ void BatterySimulator::Run()
const hrt_abstime now_us = hrt_absolute_time();
// Limit to +1.0 s to guard against division by 0
const float discharge_interval_us = math::max(_param_sim_bat_drain.get(), 1.0f) * 1000 * 1000;
const float discharge_interval_us = _param_sim_bat_drain.get() * 1000 * 1000;
if (_armed) {
if (_last_integration_us != 0) {