SITL , battery status in simulation

Hi, I am doing an SITL simulation, where I am using IRIS model. I observed that the battery status saved in Ulog is quite linear and after reaching 20%, it does not give any warning etc.
How can I look into the battery status algorithm in SITL?

It’s in the simulator here - https://github.com/PX4/Firmware/blob/master/src/modules/simulator/simulator_mavlink.cpp#L359

It was recently made somewhat configurable with the parameter SIM_BAT_DRAIN.

1 Like

Hi @dagar, @JulianOes, @LorenzMeier
i want to recharge the battery after if goes to 10% in the simulation. Actually I am simulation the drone to go to recharging stattion after its battery goes to 10%. Please suggest me how to update the battery voltage and percentage to 100% (I mean to say which topic should I publish or which parameter should I reset)?