mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-23 07:00:49 +08:00
* feat(battery_simulator): simulate all battery instances with per-battery drain Simulate one battery per battery_status instance instead of a single hardcoded one. The Battery array is constructed in place from battery_status_s::MAX_INSTANCES, so the simulator follows the maximum number of batteries without code changes. A battery is only published when its BAT<N>_SOURCE is set to power module, which keeps the default SITL behavior of a single battery unchanged. Add SIM_BAT<N>_DRAIN and SIM_BAT<N>_MIN_PCT to override the shared SIM_BAT_DRAIN and SIM_BAT_MIN_PCT per battery (-1 inherits the shared value), and integrate the state of charge per battery. This allows testing multi-battery behavior such as one battery draining faster than the others. * docs(simulation): describe simulating multiple batteries Document how additional simulated batteries are enabled through BAT<N>_SOURCE and how SIM_BAT<N>_DRAIN and SIM_BAT<N>_MIN_PCT override the shared drain parameters per battery. * docs(simulation): clarify per-battery fallback rules