carla-simulator / carla

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

a get_spawn_points for walkers #4199

Open qhaas opened 3 years ago

qhaas commented 3 years ago

Per the spawnnpc example, the suggested way to get spawn points for walkers is to use get_random_location_from_navigation.

For vehicles, if one wants to avoid spawn point collisions and maximize the number of vehicles in a simulation, one can use get_spawn_points to return a list of vehicular spawn points.

It would be useful to have a similar method that returns a list of suggested spawn points for walkers. This would also solve Issue #2136 since users could use random.choice with a fixed seed to select from a list of walker spawn points.

stale[bot] commented 3 years 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.

qhaas commented 3 years ago

I did not see a way to get 'suggested' spawn points in CARLA 0.9.12 like one can do with vehicles. Given we don't know if there will be a collision or other interference with spawning walkers until we try to actually spawn them, it hampers our ability to know how many walkers we will get when we batch up the spawn actor commands.

Created the script below that iterates through each town, displays how many suggested vehicle spawn points there are (for reference) and attempts to spawn thousands of walkers at random locations. Given the disparity between attempted spawns and successful spawns, we need a better way to select walker spawn points.

town Town01, supports 255 vehicles, successfully spawned 8718 walkers of 16384 attempts
town Town02, supports 101 vehicles, successfully spawned 9492 walkers of 16384 attempts
town Town03, supports 265 vehicles, successfully spawned 11161 walkers of 16384 attempts
town Town04, supports 372 vehicles, successfully spawned 11407 walkers of 16384 attempts
town Town05, supports 302 vehicles, successfully spawned 11466 walkers of 16384 attempts
town Town06, supports 436 vehicles, successfully spawned 9917 walkers of 16384 attempts
town Town07, supports 116 vehicles, successfully spawned 13331 walkers of 16384 attempts
town Town10HD, supports 155 vehicles, successfully spawned 12697 walkers of 16384 attempts

findWalkerCap.txt

stale[bot] commented 2 years 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.

ricardodeazambuja commented 2 years ago

I was trying to get feasible spawn points for walkers, so I decided to try get_random_location_from_navigation. However, it seems to be sampling always from the same map (?!?). I saw that after I modified the code from @qhaas to visualise the points:

keeees commented 2 years ago

Any update on this issue?

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.

alexx-km commented 8 months ago

I was trying to get feasible spawn points for walkers, so I decided to try get_random_location_from_navigation. However, it seems to be sampling always from the same map (?!?). I saw that after I modified the code from @qhaas to visualise the points:

I have the same issue. It seems to be only an issue for the new and large maps (11-15). Do you have any idea what the problem is / was?