diff --git a/apps/commander/state_machine_helper.c b/apps/commander/state_machine_helper.c index a64d99cd49..891efe9d79 100644 --- a/apps/commander/state_machine_helper.c +++ b/apps/commander/state_machine_helper.c @@ -579,6 +579,8 @@ uint8_t update_state_machine_mode_request(int status_pub, struct vehicle_status_ state_machine_publish(status_pub, current_status, mavlink_fd); publish_armed_status(current_status); printf("[commander] Enabling HIL, locking down all actuators for safety.\n\t(Arming the system will not activate them while in HIL mode)\n"); + } else if (current_status->state_machine != SYSTEM_STATE_STANDBY) { + mavlink_log_critical(mavlink_fd, "[commander] REJECTING switch to HIL, not in standby.") } /* NEVER actually switch off HIL without reboot */ diff --git a/apps/drivers/hil/hil.cpp b/apps/drivers/hil/hil.cpp index bef21848b5..ecccfb5b0f 100644 --- a/apps/drivers/hil/hil.cpp +++ b/apps/drivers/hil/hil.cpp @@ -824,6 +824,7 @@ hil_main(int argc, char *argv[]) // XXX all modes have PWM settings if (argc > i + 1) { pwm_update_rate_in_hz = atoi(argv[i + 1]); + printf("pwm update rate: %d Hz\n", pwm_update_rate_in_hz); } else { fprintf(stderr, "missing argument for pwm update rate (-u)\n"); return 1; diff --git a/apps/mavlink/mavlink.c b/apps/mavlink/mavlink.c index 2527e0b0ff..991bbfbab6 100644 --- a/apps/mavlink/mavlink.c +++ b/apps/mavlink/mavlink.c @@ -163,8 +163,8 @@ set_hil_on_off(bool hil_enabled) /* 20 Hz */ hil_rate_interval = 50; } else { - /* 100 Hz */ - hil_rate_interval = 10; + /* 200 Hz */ + hil_rate_interval = 5; } orb_set_interval(mavlink_subs.spa_sub, hil_rate_interval);