commander: remove unused HITL transition function

To my knowledge this hil transition function is not used anymore,
however, it makes sending the DO_SET_MODE command unnecessarily complex.
In my opinion the DO_SET_MODE command should only change the mode but
not other things like arming (already removed) and HITL state (this
commit).

Often times, I was seeing the error message "Set SYS_HITL to 1 and
reboot to enable HITL." when using QGC with a vehicle in HITL.

HITL is set via parameter which then has an impact in the startup script
where the CLI argument `-hil` is added to some of the commands that
require it (like commander as well).
This commit is contained in:
Julian Oes
2018-08-29 18:24:19 -07:00
committed by Beat Küng
parent f3e576b6f4
commit d370a7c2b5
3 changed files with 1 additions and 67 deletions
+1 -5
View File
@@ -593,10 +593,6 @@ Commander::handle_command(vehicle_status_s *status_local, const vehicle_command_
transition_result_t main_ret = TRANSITION_NOT_CHANGED;
/* set HIL state */
hil_state_t new_hil_state = (base_mode & VEHICLE_MODE_FLAG_HIL_ENABLED) ? vehicle_status_s::HIL_STATE_ON : vehicle_status_s::HIL_STATE_OFF;
transition_result_t hil_ret = hil_state_transition(new_hil_state, status_pub, status_local, &mavlink_log_pub);
// We ignore base_mode & VEHICLE_MODE_FLAG_SAFETY_ARMED because
// the command VEHICLE_CMD_COMPONENT_ARM_DISARM should be used
// instead according to the latest mavlink spec.
@@ -704,7 +700,7 @@ Commander::handle_command(vehicle_status_s *status_local, const vehicle_command_
}
}
if ((hil_ret != TRANSITION_DENIED) && (arming_ret != TRANSITION_DENIED) && (main_ret != TRANSITION_DENIED)) {
if ((arming_ret != TRANSITION_DENIED) && (main_ret != TRANSITION_DENIED)) {
cmd_result = vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED;
} else {