I am working on implementing PX4 HITL functionality for an in-house developed simulator and Pixhawk Hex-Cube hardware. I’m new to PX4 in general (previously worked with ArduCopter SITL) and I have a few questions about working with the Simulator MAVLink API:
What is the recommended update rate for running a quad-rotor model? (IIRC, minimum 800Hz physics-loop was recommended for ArduCopter SITL running lock-step, but I’m guessing HITL MAVLink communication is asynchronous?)
I’ve found multiple setups documented for bridging MAVLink from the GCS and simulator into the AP serial interface:
In the links above, examples are shown with the GCS piped through the simulator and simulator piped through GCS–is one the preferred method?
Looking through the messages listed here (https://docs.px4.io/master/en/simulation/), I see that the HIL_SENSOR message has a field documented as follows:
“fields_updated uint32_t Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.”
Does this bit perform a reset of the hardware AP, e.g. for initializing a new simulation case?
3a. Related to above: is it possible to initialize the AP in flight, or do simulations need to start on the ground?
Appreciate any tips from those who have done this before. Additional documentation or code to look at would be great, too.