diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index dbd837d40b..e7a6ae984d 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -248,7 +248,12 @@ then fi load_mon start -battery_simulator start + +if param compare SIM_BAT_ENABLE 1 +then + battery_simulator start +fi + tone_alarm start rc_update start manual_control start diff --git a/src/modules/simulation/battery_simulator/battery_simulator_params.c b/src/modules/simulation/battery_simulator/battery_simulator_params.c index d634714cf3..986ae0b596 100644 --- a/src/modules/simulation/battery_simulator/battery_simulator_params.c +++ b/src/modules/simulation/battery_simulator/battery_simulator_params.c @@ -31,6 +31,18 @@ * ****************************************************************************/ +/** + * Simulator Battery enabled + * + * Enable or disable the internal battery simulation. This is useful + * when the battery is simulated externally and interfaced with PX4 + * through MAVLink for example. + * + * @boolean + * @group SITL + */ +PARAM_DEFINE_INT32(SIM_BAT_ENABLE, 1); + /** * Simulator Battery drain interval *