I’m working on a bare-bones SITL simulator that communicates with PX4.
I have read the documentation provided in the PX4 docs (Simulation | PX4 User Guide) and I have implemented a simple event loop where I periodically publish messages to PX4.
I’m currently using the MAVLink c++ library to communicate to PX4 over TCP (tcp port 4560) and I’m receiving the initial COMMAND_LONG message for HIL_ACTUATOR_CONTROLS frequency, along with a HEARTBEAT.
After this initial “handshake” sequence I periodically post the following messages (from the simulator to PX4):
HEARTBEAT
HIL_SENSOR
HIL_GPS
HIL_STATE_QUATERNION
but PX4 is not responding with any additional message (from the documentation I was expecting a HIL_ACTUATOR_CONTROLS message).
Is there any documentation on the correct handshake sequence and/or any message I might have forgotten?
thanks for the info!
I tried changing the SYS_HITL parameter to 1 and rebooted the autopilot.
I double-checked that upon restart the parameter was kept unchanged.
Still, I am not receiving any HIL_ACTUATOR_CONTROLS.
Could this be due to invalid sensor readings? I am passing zeroed out values for most things (airspeed, ground speed, attitude, etc…).Thanks
I just tried sending dummy values for the HIL_SENSOR message by copying what jmavsim sends.
With those, I’m getting the HIL_ACTUATOR_CONTROLS message response!
It was a problem with the contents of my message, not the delivery.
Thanks for your help!