Skip to content

Commit

Permalink
Fixed the summary message to be "Not updated" when the gyro bias is n…
Browse files Browse the repository at this point in the history
…ot updated.

Fixed typo.

Signed-off-by: TaikiYamada4 <[email protected]>
  • Loading branch information
TaikiYamada4 committed Jan 19, 2024
1 parent 2bc4949 commit 4d9627e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sensing/imu_corrector/src/gyro_bias_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,15 @@ void GyroBiasEstimator::update_diagnostics(diagnostic_updater::DiagnosticStatusW
std::abs(estimated_gyro_bias_z) < gyro_bias_threshold_;

// Update diagnostics
// The summary depends on which of the three states you are in:
// updated, not updated, or threshold exceeded.
if (is_bias_small_enough) {
stat.summary(diagnostic_msgs::msg::DiagnosticStatus::OK, "Succeccefully updated");
if (is_bias_updated_) {
stat.summary(diagnostic_msgs::msg::DiagnosticStatus::OK, "Successfully updated");
}
else {
stat.summary(diagnostic_msgs::msg::DiagnosticStatus::OK, "Not updated");
}
} else {
stat.summary(diagnostic_msgs::msg::DiagnosticStatus::WARN,
"Gyro bias may be incorrect. Please calibrate IMU and reflect the result in "
Expand Down

0 comments on commit 4d9627e

Please sign in to comment.