Skip to content

Commit

Permalink
Updated IrisOrca to stop spamming GCS error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
agregghai committed May 30, 2024
1 parent eb849df commit f10f940
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions libraries/AP_IrisOrca/AP_IrisOrca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ void AP_IrisOrca::thread_main()
if (_actuator_state.errors != 0) {
// send sleep command if in error state to attempt to clear the error
send_actuator_sleep_cmd();
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "IrisOrca: Error %i", _actuator_state.errors);
if (now_ms - _last_error_report_ms > IRISORCA_ERROR_REPORT_INTERVAL_MAX_MS) {
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "IrisOrca: Error %i", _actuator_state.errors);
_last_error_report_ms = now_ms;
}
continue;
}

Expand Down Expand Up @@ -515,7 +518,7 @@ void AP_IrisOrca::send_actuator_sleep_cmd()
WITH_SEMAPHORE(_last_healthy_sem);
_last_send_actuator_ms = AP_HAL::millis();

GCS_SEND_TEXT(MAV_SEVERITY_INFO, "IrisOrca: Actuator sleep command sent");
// GCS_SEND_TEXT(MAV_SEVERITY_INFO, "IrisOrca: Actuator sleep command sent");
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_IrisOrca/AP_IrisOrca.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class AP_IrisOrca {
uint32_t _last_send_actuator_ms; // system time (in millis) last actuator position command was sent (used for health reporting)
uint32_t _send_start_us; // system time (in micros) when last message started being sent (used for timing to unset DE pin)
uint32_t _send_delay_us; // delay (in micros) to allow bytes to be sent after which pin can be unset. 0 if not delaying

uint32_t _last_error_report_ms; // system time (in millis) that last error was reported (used to avoid spamming errors)

// health reporting
HAL_Semaphore _last_healthy_sem;// semaphore protecting reading and updating of _last_send_actuator_ms and _last_received_ms
Expand Down

0 comments on commit f10f940

Please sign in to comment.