From 17c9cedac18a006f23cbb36f4064f9f20dc94867 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 23 Nov 2013 18:27:12 +1100 Subject: [PATCH] Plane: send out HIL servo updates as soon as we can this improves the servo responsiveness of HIL a lot --- ArduPlane/Attitude.pde | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArduPlane/Attitude.pde b/ArduPlane/Attitude.pde index 1db4c65050..df0ae0fc7e 100644 --- a/ArduPlane/Attitude.pde +++ b/ArduPlane/Attitude.pde @@ -856,6 +856,10 @@ static void set_servos(void) } #if HIL_MODE != HIL_MODE_DISABLED + // get the servos to the GCS immediately for HIL + if (comm_get_txspace(MAVLINK_COMM_0) - MAVLINK_NUM_NON_PAYLOAD_BYTES >= MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN) { + send_radio_out(MAVLINK_COMM_0); + } if (!g.hil_servos) { return; } @@ -887,7 +891,7 @@ static void set_servos(void) #endif #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 g.rc_12.output_ch(CH_12); - # endif + #endif } static bool demoing_servos;