Skip to content

Commit 28e2cda

Browse files
authored
fix(autoware_pointcloud_preprocessor): fix redundantInitialization (#8229)
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
1 parent 281dea3 commit 28e2cda

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

sensing/autoware_pointcloud_preprocessor/src/blockage_diag/blockage_diag_nodelet.cpp

+2-8
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void BlockageDiagComponent::onBlockageChecker(DiagnosticStatusWrapper & stat)
108108
// TODO(badai-nguyen): consider sky_blockage_ratio_ for DiagnosticsStatus." [todo]
109109

110110
auto level = DiagnosticStatus::OK;
111-
std::string msg;
111+
std::string msg = "OK";
112112
if (ground_blockage_ratio_ < 0) {
113113
level = DiagnosticStatus::STALE;
114114
msg = "STALE";
@@ -120,9 +120,6 @@ void BlockageDiagComponent::onBlockageChecker(DiagnosticStatusWrapper & stat)
120120
} else if (ground_blockage_ratio_ > 0.0f) {
121121
level = DiagnosticStatus::WARN;
122122
msg = "WARN";
123-
} else {
124-
level = DiagnosticStatus::OK;
125-
msg = "OK";
126123
}
127124

128125
if ((ground_blockage_ratio_ > 0.0f) && (sky_blockage_ratio_ > 0.0f)) {
@@ -139,7 +136,7 @@ void BlockageDiagComponent::dustChecker(diagnostic_updater::DiagnosticStatusWrap
139136
{
140137
stat.add("ground_dust_ratio", std::to_string(ground_dust_ratio_));
141138
auto level = DiagnosticStatus::OK;
142-
std::string msg;
139+
std::string msg = "OK";
143140
if (ground_dust_ratio_ < 0.0f) {
144141
level = DiagnosticStatus::STALE;
145142
msg = "STALE";
@@ -150,9 +147,6 @@ void BlockageDiagComponent::dustChecker(diagnostic_updater::DiagnosticStatusWrap
150147
} else if (ground_dust_ratio_ > 0.0f) {
151148
level = DiagnosticStatus::WARN;
152149
msg = "WARN";
153-
} else {
154-
level = DiagnosticStatus::OK;
155-
msg = "OK";
156150
}
157151

158152
if (ground_dust_ratio_ > 0.0f) {

0 commit comments

Comments
 (0)