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

add support for rendering LaneMarkType.SOLID_DASH_WHITE in EgoViewMapRenderer #9

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/av2/rendering/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ def render_lane_boundary_egoview(
dash_interval_m=DASH_INTERVAL_M,
)

elif (mark_type == LaneMarkType.SOLID_DASH_YELLOW and side == "right") or (
elif (mark_type in [LaneMarkType.SOLID_DASH_WHITE, LaneMarkType.SOLID_DASH_YELLOW] and side == "right") or (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @johnlambert-argo. What are your thoughts on defining the valid line types as:

VALID_MARK_TYPES = set([LaneMarkType.SOLID_DASH_WHITE, LaneMarkType.SOLID_DASH_YELLOW]) (or whichever variable name is suitable)

and then reusing this set on line 128 and 136?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look Ben. Technically, all the lane types are valid types, but only one will be used for any boundary. We could use an alias like SOLID_DASH_TYPES here, but I think it might be more readable to just list out directly.

mark_type == LaneMarkType.DASH_SOLID_YELLOW and side == "left"
):
self.render_polyline_egoview(left, img_bgr, bound_color, thickness_px=line_width_px)
self.draw_dashed_polyline_egoview(
right, img_bgr, bound_color, thickness_px=line_width_px, dash_interval_m=DASH_INTERVAL_M
)

elif (mark_type == LaneMarkType.SOLID_DASH_YELLOW and side == "left") or (
elif (mark_type in [LaneMarkType.SOLID_DASH_WHITE, LaneMarkType.SOLID_DASH_YELLOW] and side == "left") or (
mark_type == LaneMarkType.DASH_SOLID_YELLOW and side == "right"
):
self.draw_dashed_polyline_egoview(
Expand Down