Skip to content

Commit

Permalink
Changed to append_issue_code_prefix.
Browse files Browse the repository at this point in the history
Added test for TrafficLight.CorrectFacing-001

Signed-off-by: TaikiYamada4 <[email protected]>
  • Loading branch information
TaikiYamada4 committed Nov 27, 2024
1 parent 7b08802 commit 8cee06a
Show file tree
Hide file tree
Showing 4 changed files with 468 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ MissingReferrersForTrafficLightsValidator::check_missing_referrers_for_traffic_l
issues.emplace_back(
lanelet::validation::Severity::Error, lanelet::validation::Primitive::RegulatoryElement,
reg_elem->id(),
issue_code_prefix(this->name(), 1) +
"Regulatory element of traffic light must be referred by at least one lanelet.");
append_issue_code_prefix(
this->name(), 1,
"Regulatory element of traffic light must be referred by at least one lanelet."));
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ lanelet::validation::Issues TrafficLightFacingValidator::check_traffic_light_fac
linestring_to_vector3d(get_starting_edge_from_lanelet(referring_lanelets[i], stop_line));
double cosine_angle =
pseudo_stop_line.dot(comparing_line) / (pseudo_stop_line.norm() * comparing_line.norm());
if (cosine_angle < 0) {
if (cosine_angle < 0.707) { // about 45 deg
issues.emplace_back(
lanelet::validation::Severity::Info, lanelet::validation::Primitive::LineString,
refers_linestring.id(),
issue_code_prefix(this->name(), 1) +
"Lanelets referring this traffic_light have several divergent starting lines");
append_issue_code_prefix(
this->name(), 1,
"Lanelets referring this traffic_light have several divergent starting lines"));
}
}

Expand All @@ -122,12 +123,12 @@ lanelet::validation::Issues TrafficLightFacingValidator::check_traffic_light_fac
if (!tl_has_been_judged_as_correct[id] && tl_has_been_judged_as_wrong[id]) {
issues.emplace_back(
lanelet::validation::Severity::Error, lanelet::validation::Primitive::LineString, id,
issue_code_prefix(this->name(), 2) + "The linestring direction seems to be wrong.");
append_issue_code_prefix(this->name(), 2, "The linestring direction seems to be wrong."));
} else if (tl_has_been_judged_as_correct[id] && tl_has_been_judged_as_wrong[id]) {
issues.emplace_back(
lanelet::validation::Severity::Warning, lanelet::validation::Primitive::LineString, id,
issue_code_prefix(this->name(), 3) +
"The linestring direction has been judged as both correct and wrong.");
append_issue_code_prefix(
this->name(), 3, "The linestring direction has been judged as both correct and wrong."));
}
}

Expand Down
Loading

0 comments on commit 8cee06a

Please sign in to comment.