carla-simulator / carla

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

waypoints missing? (IndexError: deque index out of range) #3764

Closed kino3 closed 3 years ago

kino3 commented 3 years ago

Describe the bug I'm trying to play the following OpenSCENARIO (sample.xosc) which describes intersection (X-Junction-sample.xodr). The ego vehicle goes straight and the other vehicle turns left according to the waypoints in the OpenScenario. scenario.zip

However, the ego vehicle suddenly vanished since it cannot find next waypoints (I suppose).

Traceback (most recent call last):
  File "scenario_runner.py", line 399, in _load_and_run_scenario
    self.manager.run_scenario()
  File "/home/shuji/Documents/git/scenario_runner/srunner/scenariomanager/scenario_manager.py", line 133, in run_scenario
    self._tick_scenario(timestamp)
  File "/home/shuji/Documents/git/scenario_runner/srunner/scenariomanager/scenario_manager.py", line 174, in _tick_scenario
    self.scenario_tree.tick_once()
  File "/home/shuji/.local/lib/python3.6/site-packages/py_trees/behaviour.py", line 158, in tick_once
    for unused in self.tick():
  File "/home/shuji/.local/lib/python3.6/site-packages/py_trees/composites.py", line 578, in tick
    for node in child.tick():
  File "/home/shuji/.local/lib/python3.6/site-packages/py_trees/behaviour.py", line 249, in tick
    new_status = self.update()
  File "/home/shuji/Documents/git/scenario_runner/srunner/scenariomanager/scenarioatomics/atomic_behaviors.py", line 364, in update
    actor_dict[actor_id].run_step()
  File "/home/shuji/Documents/git/scenario_runner/srunner/scenariomanager/actorcontrols/actor_control.py", line 154, in run_step
    self.control_instance.run_step()
  File "/home/shuji/Documents/git/scenario_runner/srunner/scenariomanager/actorcontrols/npc_vehicle_control.py", line 90, in run_step
    control = self._local_planner.run_step(debug=True)
  File "/home/shuji/Documents/git/carla/PythonAPI/carla/agents/navigation/local_planner.py", line 239, in run_step
    self._compute_next_waypoints(k=100)
  File "/home/shuji/Documents/git/carla/PythonAPI/carla/agents/navigation/local_planner.py", line 177, in _compute_next_waypoints
    last_waypoint = self._waypoints_queue[-1][0]
IndexError: deque index out of range
deque index out of range
Resetting ego-vehicle!
Resetting ego-vehicle!
Destroying ego vehicle 87
ERROR: failed to destroy actor 87 : unable to destroy actor: not found 
No more scenarios .... Exiting

Addtional context

Desktop (please complete the following information):

fabianoboril commented 3 years ago

Hi, this is a CARLA issue (see that the error occurs in the LocalPlanner of CARLA. I will move the issue to CARLA directly.

glopezdiest commented 3 years ago

This seems to be related to the OpenDRIVE map, not being properly generated.

By using the controller, the local planner calculates the waypoints using the opendrive map, and as it has some unconnected roads, the local planner fails with IndexError.

However, by using AssignRouteAction, you are just manually setting those waypoints, so no calculus in being done.

I'd recommend you make sure that the road you are at is connected to the next

kino3 commented 3 years ago

@glopezdiest Thank you for your comments. I will re-check the road connection.

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.