feat(simulation): Disable sensor calibration in HIL

This commit is contained in:
ttechnick
2026-04-01 16:31:14 +02:00
committed by Nick
parent ec0c9baed7
commit 5b87d3f628
+14
View File
@@ -1343,6 +1343,13 @@ Commander::handle_command(const vehicle_command_s &cmd)
// reject if armed or shutting down
answer_command(cmd, vehicle_command_ack_s::VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED);
} else if (_vehicle_status.hil_state == vehicle_status_s::HIL_STATE_ON) {
// reject calibration in SIH mode — simulated sensors cannot be calibrated
answer_command(cmd, vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED);
mavlink_log_critical(&_mavlink_log_pub, "Calibration denied: not supported in SIH mode\t");
events::send(events::ID("commander_calib_denied_sih"), events::Log::Critical,
"Calibration denied: not supported in SIH mode");
} else {
if ((int)(cmd.param1) == 1) {
@@ -1456,6 +1463,13 @@ Commander::handle_command(const vehicle_command_s &cmd)
// reject if armed or shutting down
answer_command(cmd, vehicle_command_ack_s::VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED);
} else if (_vehicle_status.hil_state == vehicle_status_s::HIL_STATE_ON) {
// reject calibration in SIH mode — simulated sensors cannot be calibrated
answer_command(cmd, vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED);
mavlink_log_critical(&_mavlink_log_pub, "Calibration denied: not supported in SIH mode\t");
events::send(events::ID("commander_mag_yaw_calib_denied_sih"), events::Log::Critical,
"Calibration denied: not supported in SIH mode");
} else {
answer_command(cmd, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED);
// parameter 1: Heading (degrees)