HITL for custom simulator

Hello,
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:

  1. 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?)

  2. I’ve found multiple setups documented for bridging MAVLink from the GCS and simulator into the AP serial interface:
    https://docs.px4.io/master/en/simulation/hitl.html
    https://bkueng.gitbooks.io/px4-devguide/content/en/simulation/#simulator-mavlink-api
    In the links above, examples are shown with the GCS piped through the simulator and simulator piped through GCS–is one the preferred method?

  3. 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.
Thanks!

hi @halcyon … I am trying to estbalish such a SITL simulation between PX4 and a simulink model of a quadrotor… I have established TCP connection on port 4560, but I am still unable to exchange the mavlink messages between the two… Have you been able to advance on this topic ?