Skip to content

Commit 701ba21

Browse files
veqccKhalilSelyan
authored and
KhalilSelyan
committed
fix(pointcloud_preprocessor): fix redundantInitialization warning (#7629)
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
1 parent d33812c commit 701ba21

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

sensing/pointcloud_preprocessor/src/outlier_filter/dual_return_outlier_filter_nodelet.cpp

+3-14
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,17 @@ void DualReturnOutlierFilterComponent::onVisibilityChecker(DiagnosticStatusWrapp
8585
// Add values
8686
stat.add("value", std::to_string(visibility_));
8787

88-
// Judge level
8988
auto level = DiagnosticStatus::OK;
89+
std::string msg = "OK";
9090
if (visibility_ < 0) {
9191
level = DiagnosticStatus::STALE;
92+
msg = "STALE";
9293
} else if (visibility_ < visibility_error_threshold_) {
9394
level = DiagnosticStatus::ERROR;
95+
msg = "ERROR: low visibility in dual outlier filter";
9496
} else if (visibility_ < visibility_warn_threshold_) {
9597
level = DiagnosticStatus::WARN;
96-
} else {
97-
level = DiagnosticStatus::OK;
98-
}
99-
100-
// Set message
101-
std::string msg;
102-
if (level == DiagnosticStatus::OK) {
103-
msg = "OK";
104-
} else if (level == DiagnosticStatus::WARN) {
10598
msg = "WARNING: low visibility in dual outlier filter";
106-
} else if (level == DiagnosticStatus::ERROR) {
107-
msg = "ERROR: low visibility in dual outlier filter";
108-
} else if (level == DiagnosticStatus::STALE) {
109-
msg = "STALE";
11099
}
111100
stat.summary(level, msg);
112101
}

0 commit comments

Comments
 (0)