Skip to content

Commit

Permalink
fix(pointcloud_preprocessor): fix redundantInitialization warning (au…
Browse files Browse the repository at this point in the history
…towarefoundation#7629)

Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc authored and tby-udel committed Jul 14, 2024
1 parent fede0dc commit ff0cb9d
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,17 @@ void DualReturnOutlierFilterComponent::onVisibilityChecker(DiagnosticStatusWrapp
// Add values
stat.add("value", std::to_string(visibility_));

// Judge level
auto level = DiagnosticStatus::OK;
std::string msg = "OK";
if (visibility_ < 0) {
level = DiagnosticStatus::STALE;
msg = "STALE";
} else if (visibility_ < visibility_error_threshold_) {
level = DiagnosticStatus::ERROR;
msg = "ERROR: low visibility in dual outlier filter";
} else if (visibility_ < visibility_warn_threshold_) {
level = DiagnosticStatus::WARN;
} else {
level = DiagnosticStatus::OK;
}

// Set message
std::string msg;
if (level == DiagnosticStatus::OK) {
msg = "OK";
} else if (level == DiagnosticStatus::WARN) {
msg = "WARNING: low visibility in dual outlier filter";
} else if (level == DiagnosticStatus::ERROR) {
msg = "ERROR: low visibility in dual outlier filter";
} else if (level == DiagnosticStatus::STALE) {
msg = "STALE";
}
stat.summary(level, msg);
}
Expand Down

0 comments on commit ff0cb9d

Please sign in to comment.