Skip to content

Commit

Permalink
Group MCU diagnostics together
Browse files Browse the repository at this point in the history
  • Loading branch information
hilary-luo committed Jan 25, 2025
1 parent 8388a54 commit 6059518
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions clearpath_diagnostics/config/diagnostic_aggregator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ diagnostic_aggregator:
type: diagnostic_aggregator/AnalyzerGroup
path: Platform
analyzers:
firmware:
mcu:
type: diagnostic_aggregator/GenericAnalyzer
path: Firmware
contains: [ 'Firmware' ]
path: MCU
contains: [ 'MCU' ]
sensors:
type: diagnostic_aggregator/AnalyzerGroup
path: Sensors
Expand Down
7 changes: 3 additions & 4 deletions clearpath_diagnostics/src/clearpath_diagnostic_updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ClearpathDiagnosticUpdater::ClearpathDiagnosticUpdater()
if (latest_apt_firmware_version_ != "simulated") {
// Publish MCU Status information as diagnostics
updater_.add("MCU Status", this, &ClearpathDiagnosticUpdater::mcu_status_diagnostic);
updater_.add("Firmware Version", this, &ClearpathDiagnosticUpdater::check_firmware_version);
updater_.add("MCU Firmware Version", this, &ClearpathDiagnosticUpdater::check_firmware_version);
}

mcu_status_rate_ = 1.0;
Expand Down Expand Up @@ -115,15 +115,14 @@ void ClearpathDiagnosticUpdater::mcu_callback(const clearpath_platform_msgs::msg
void ClearpathDiagnosticUpdater::mcu_status_diagnostic(
diagnostic_updater::DiagnosticStatusWrapper & stat)
{
mcu_freq_status_->run(stat);

// add to append key-value pairs to the diagnostic
stat.add("Firmware Version", mcu_firmware_version_);
stat.add("Platform Model", mcu_platform_model_);
stat.add("MCU Uptime", mcu_uptime_);
stat.add("Connection Uptime", connection_uptime_);
stat.add("MCU Temperature", mcu_temperature_);
stat.add("PCB Temperature", pcb_temperature_);

mcu_freq_status_->run(stat);
}

void ClearpathDiagnosticUpdater::setup_topic_rate_diagnostics()
Expand Down

0 comments on commit 6059518

Please sign in to comment.