Skip to content

Commit

Permalink
UPdate
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh committed Aug 27, 2024
1 parent 4bc854b commit f8079ac
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions qc_opendrive/checks/semantic/road_lane_level_true_one_side.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _check_true_level_on_side(
root: etree._ElementTree,
side_lanes: List[etree._Element],
road: etree._ElementTree,
lane_section: etree._ElementTree,
lane_section_with_length: models.LaneSectionWithLength,
result: Result,
rule_uid: str,
) -> None:
Expand Down Expand Up @@ -61,15 +61,18 @@ def _check_true_level_on_side(
description=f"Lane id {index} @level=False where previous lane id @level=True.",
)

s_section = utils.get_s_from_lane_section(lane_section)
s_section = utils.get_s_from_lane_section(
lane_section_with_length.lane_section
)
if s_section is None:
continue

s = s_section + lane_section_with_length.length / 2.0
t = utils.get_t_middle_point_from_lane_by_s(
road, lane_section, lane, s_section
road, lane_section_with_length.lane_section, lane, s
)

inertial_point = utils.get_point_xyz_from_road(road, s_section, t, 0.0)
inertial_point = utils.get_point_xyz_from_road(road, s, t, 0.0)
if inertial_point is not None:
result.add_inertial_location(
checker_bundle_name=constants.BUNDLE_NAME,
Expand Down Expand Up @@ -279,9 +282,12 @@ def _check_level_in_lane_section(
) -> None:
roads = utils.get_roads(checker_data.input_file_xml_root)
for road in roads:
lane_sections = utils.get_lane_sections(road)
lane_sections_with_length = (
utils.get_sorted_lane_sections_with_length_from_road(road)
)

for lane_section in lane_sections:
for lane_section_with_length in lane_sections_with_length:
lane_section = lane_section_with_length.lane_section
left_lanes_list = utils.get_left_lanes_from_lane_section(lane_section)
right_lanes_list = utils.get_right_lanes_from_lane_section(lane_section)

Expand All @@ -295,7 +301,7 @@ def _check_level_in_lane_section(
checker_data.input_file_xml_root,
sorted_left_lane,
road,
lane_section,
lane_section_with_length,
checker_data.result,
rule_uid,
)
Expand All @@ -310,7 +316,7 @@ def _check_level_in_lane_section(
checker_data.input_file_xml_root,
sorted_right_lane,
road,
lane_section,
lane_section_with_length,
checker_data.result,
rule_uid,
)
Expand Down

0 comments on commit f8079ac

Please sign in to comment.