carla-simulator / carla

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

Problem about generation and visualization of waypoints in carla #6727

Open HanxinWang666 opened 1 year ago

HanxinWang666 commented 1 year ago

Hi everyone, I met a strange problem. When I try to generate waypoints and visualize them. The Result is: 1. It looks normal. But when I try to generate two sets of waypoints and visualize them. Something strange happened: The generated waypoints have increased in number and become disorganized. The distances between some waypoints are even visibly uneven.

My codes are: import carla client = carla.Client('localhost', 2000) client.set_timeout(60.0) world = client.load_world('Town10HD') map = world.get_map() debug_helper = world.debug mappoints= map.generate_waypoints(distance=10.0) for mappoint in mappoints: location = mappoint.transform.location debug_helper.draw_point(location, size=0.1, color=carla.Color(255, 0, 0), life_time=0)

and import carla client = carla.Client('localhost', 2000) client.set_timeout(60.0) world = client.load_world('Town10HD') map = world.get_map() debug_helper = world.debug mappoints= map.generate_waypoints(distance=10.0) for mappoint in mappoints: location = mappoint.transform.location debug_helper.draw_point(location, size=0.1, color=carla.Color(255, 0, 0), life_time=0)

waypoints= map.generate_waypoints(distance=2.0) for waypoint in waypoints: location = waypoint.transform.location debug_helper.draw_point(location, size=0.1, color=carla.Color(0, 255, 0), life_time=0)

Does anyone know what's going on here please? Thanks for your help!

HanxinWang666 commented 1 year ago

The generated waypoints have increased in number and become disorganized. The distances between some waypoints are even visibly uneven. 2