While trying to bring the Arduplane 3.4 into HIL Mode on Pixhawk V2 board, by setting the HIL_MODE parameter to 1 I keep getting the message “Waiting for first HIL_STATE message” in the GCS window. On doing a little investigation I found that Arduplane\system.cpp has a barometer health check method (line#551) which uses the system uptime through the call barometer.get_last_update()
. The returned value from this is definitely 0 because MP is indefinitely showing this message as a result of which the Pixhawk never gets into HIL Mode.
The get_last_update() makes a call to millis()
function which returns time in milliseconds from system boot up in AP_Baro_Backend.cpp. What could be the reason that the millis() function is returning zero?
I referred the following website http://dev.ardupilot.com/wiki/learning-ardupilot-threading/ and the high resolution timer function should be doing this update. I did find millis()
tracing back to PX4Firmware/unittests/hrt.cpp. Am I looking at the correct implementation of millis() as this function resides in multiple system.cpp files targeted for each platform (viz. APM, VRBRAIN, PX4 etc.)
I am genuinely stuck up debugging this and any help is appreciated.