Skip to content

Conversation

@yuntianyi-chen
Copy link
Contributor

@yuntianyi-chen yuntianyi-chen commented Apr 3, 2025

Fixed a bug in the _draw_polygon() function of map.py when drawing polygons for crosswalks on the HD map.

Before Fix:

image

After Fix:

image

Copy link
Owner

@daohu527 daohu527 left a comment

Choose a reason for hiding this comment

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

@yuntianyi-chen Thank you for your pr
I want to know what the problem is, increase the lethality, and add color?

@yuntianyi-chen
Copy link
Contributor Author

yuntianyi-chen commented Apr 4, 2025

@yuntianyi-chen Thank you for your pr I want to know what the problem is, increase the lethality, and add color?

The program would crash as the first image showed if the Apollo HD map contained crosswalks when you need to visualize them by calling the _draw_polygon() function.

TypeError: Polygon.init() takes 2 positional arguments but 3 were given

For this error, the constructor of matplotlib.patches.Polygon is Polygon(xy, closed=True, **kwargs), and closed is a keyword argument, not a positional one. But the original program passes it positionally, which causes the error.

@daohu527 daohu527 merged commit 30ca00e into daohu527:main Apr 4, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants