Files
ardupilot/libraries/SITL/tests
Peter BarkerandClaude Opus 4.8 c9374d661a SITL: add SIM_BATT_RES_OHM to control simulated battery sag
Commit d2fc8cac ("SITL: Improve SIM::Battery energy consumption") made
unlimited-capacity batteries (the SITL default) sag under load where they
previously had none. As the simulated voltage scales motor thrust linearly,
there was no longer any way to run a sim vehicle without that thrust penalty.

Add a SIM_BATT_RES_OHM parameter that overrides the vehicle model's internal
resistance: negative keeps the model value (unchanged default behaviour), 0
disables sag entirely, and a positive value sets an explicit resistance. It is
applied live via Battery::maybe_reset(), so it can be changed without a reboot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 09:37:48 +10:00
..
…