carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.12k stars 3.59k forks source link

The locations of crosswalk`s polygon which get from PythonAPI seems not correct. #5790

Open 1604148641 opened 1 year ago

1604148641 commented 1 year ago

The locations of crosswalk`s polygon which get from PythonAPI seems not correct. How can I fix these coordinates cause I want to generate some dataset for crosswalk throught this API.

Here is the code I draw the outline of crosswalk:

# get coordinates 
crosswalks_list = world.get_map().get_crosswalks()

# split up
list_of_groups = zip(*(iter(crosswalks_list),) * 5)
cw_polygons = [list(i) for i in list_of_groups]
count = len(crosswalks_list) % 2
cw_polygons.append(crosswalks_list[-count:]) if count != 0 else cw_polygons

# draw line
for cw in cw_polygons:
    cw[0].z = 0.5
    cw[1].z = 0.5
    cw[2].z = 0.5
    cw[3].z = 0.5
    client.get_world().debug.draw_line(cw[0], cw[1], thickness=0.1, color=carla.Color(255, 0, 0), life_time=0)
    client.get_world().debug.draw_line(cw[1], cw[2], thickness=0.1, color=carla.Color(255, 0, 0), life_time=0)
    client.get_world().debug.draw_line(cw[2], cw[3], thickness=0.1, color=carla.Color(255, 0, 0), life_time=0)
    client.get_world().debug.draw_line(cw[3], cw[0], thickness=0.1, color=carla.Color(255, 0, 0), life_time=0)

The final result: res1 res2

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ccysway commented 1 year ago

Hi, I met the same problem.It seems good in https://odrviewer.io/,but not right in carla-0.9.14. shoot_odrviewer_01 scenriobasic_crosswalk

rodrigoqueiroz commented 4 months ago

I'm having the same issue. All crosswalks are off in some degree.