PX4 SITL measure time in the air as a product of power consumption

Hello!

Is there a way to connect a realistic battery simulation for SITL to estimate how long an Iris model can stay up in the air with power? This is in relation to comparing the difference in power consumption for different ROS computations.

I am running SITL using the Avoidance ROS node to perform navigation. I have noticed that the SITL battery simulation is linear and not dependent on thrust or load weight, but there seem to be a Battery Module Setup Battery and Power Module Setup | PX4 User Guide that requires the actual hardware.

In my case the ROS nodes are placed on a companion computer that is serially connected to the PX4, but so far I can only do SITL simulation.

Looking forward to your insights and answers,
Magnus

There are two params to adjust battery simulation: https://dev.px4.io/master/en/advanced/parameter_reference.html#sitl

However, it’s still quite rudimentary.