Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync upstream #51

Merged
merged 10 commits into from
May 30, 2022
Prev Previous commit
Next Next commit
chore: change lidar blockage message (#971)
* chore: change lidar blockage message

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add Diagnostics level into message

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
  • Loading branch information
badai-nguyen authored May 27, 2022
commit c69fb17decb9dfb862938cbfad94084f5d3b6896
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,29 @@ void BlockageDiagComponent::onBlockageChecker(DiagnosticStatusWrapper & stat)
// TODO(badai-nguyen): consider sky_blockage_ratio_ for DiagnosticsStatus." [todo]

auto level = DiagnosticStatus::OK;
std::string msg;
if (ground_blockage_ratio_ < 0) {
level = DiagnosticStatus::STALE;
msg = "STALE";
} else if (
(ground_blockage_ratio_ > blockage_ratio_threshold_) &&
(ground_blockage_count_ > blockage_count_threshold_)) {
level = DiagnosticStatus::ERROR;
msg = "ERROR";
} else if (ground_blockage_ratio_ > 0.0f) {
level = DiagnosticStatus::WARN;
msg = "WARN";
} else {
level = DiagnosticStatus::OK;
msg = "OK";
}

std::string msg;
if (level == DiagnosticStatus::OK) {
msg = "OK";
} else if (level == DiagnosticStatus::WARN) {
msg = "WARNING: LiDAR blockage";
} else if (level == DiagnosticStatus::ERROR) {
msg = "ERROR: LiDAR blockage";
} else if (level == DiagnosticStatus::STALE) {
msg = "STALE";
if ((ground_blockage_ratio_ > 0.0f) && (sky_blockage_ratio_ > 0.0f)) {
msg = msg + ": LIDAR both blockage";
} else if (ground_blockage_ratio_ > 0.0f) {
msg = msg + ": LIDAR ground blockage";
} else if (sky_blockage_ratio_ > 0.0f) {
msg = msg + ": LIDAR sky blockage";
}
stat.summary(level, msg);
}
Expand Down