Skip to content

Commit

Permalink
fix(autoware_pointcloud_preprocessor): fix redundantInitialization (#…
Browse files Browse the repository at this point in the history
…8229)

Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc authored Jul 29, 2024
1 parent 281dea3 commit 28e2cda
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void BlockageDiagComponent::onBlockageChecker(DiagnosticStatusWrapper & stat)
// TODO(badai-nguyen): consider sky_blockage_ratio_ for DiagnosticsStatus." [todo]

auto level = DiagnosticStatus::OK;
std::string msg;
std::string msg = "OK";
if (ground_blockage_ratio_ < 0) {
level = DiagnosticStatus::STALE;
msg = "STALE";
Expand All @@ -120,9 +120,6 @@ void BlockageDiagComponent::onBlockageChecker(DiagnosticStatusWrapper & stat)
} else if (ground_blockage_ratio_ > 0.0f) {
level = DiagnosticStatus::WARN;
msg = "WARN";
} else {
level = DiagnosticStatus::OK;
msg = "OK";
}

if ((ground_blockage_ratio_ > 0.0f) && (sky_blockage_ratio_ > 0.0f)) {
Expand All @@ -139,7 +136,7 @@ void BlockageDiagComponent::dustChecker(diagnostic_updater::DiagnosticStatusWrap
{
stat.add("ground_dust_ratio", std::to_string(ground_dust_ratio_));
auto level = DiagnosticStatus::OK;
std::string msg;
std::string msg = "OK";
if (ground_dust_ratio_ < 0.0f) {
level = DiagnosticStatus::STALE;
msg = "STALE";
Expand All @@ -150,9 +147,6 @@ void BlockageDiagComponent::dustChecker(diagnostic_updater::DiagnosticStatusWrap
} else if (ground_dust_ratio_ > 0.0f) {
level = DiagnosticStatus::WARN;
msg = "WARN";
} else {
level = DiagnosticStatus::OK;
msg = "OK";
}

if (ground_dust_ratio_ > 0.0f) {
Expand Down

0 comments on commit 28e2cda

Please sign in to comment.