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

error with traffic light #134

Open
353xiong opened this issue Jan 8, 2025 · 1 comment
Open

error with traffic light #134

353xiong opened this issue Jan 8, 2025 · 1 comment

Comments

@353xiong
Copy link

353xiong commented Jan 8, 2025

data_collect.py
for npc in traffic_light.lights:
new_bbox = None
min_dis = 50
for light_bbox in traffic_light_bbox_nearby:
dis = compute_2d_distance(npc.get_transform().location, light_bbox.location)
if dis < min_dis:
new_bbox = light_bbox
min_dis = dis
if min_dis > 20:
continue
How can the matching of traffic light and traffic light box be based on the closest distance?

@jayyoung0802
Copy link
Member

There are several issues to be aware of.

  • In the official implementation of Carla, the API (light actor) can be used to obtain the bounding box (including the pole and the light). However, the pole is not necessary.
  • To get the bounding box for the light only, the world.get_level_bbs API can be used but does not provide additional information, such as the light ID. Therefore, we match the closest light using the distance as a reference.

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

No branches or pull requests

2 participants