mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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:
parent
da9d8342db
commit
6380c4fdee
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user