carla-simulator / carla

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

[Python agents] `set_destination` has unused parameter and `_tailgating` bugged #7341

Open Daraan opened 2 months ago

Daraan commented 2 months ago

Carla 0.9.15 and before:

The problem:

The set_destination function currently is illogical as it only uses the start_location for boolean evaluation and not as a location anymore.

https://github.com/carla-simulator/carla/blob/cead6d1b05e89ad84df80984f62daba57bb50e55/PythonAPI/carla/agents/navigation/basic_agent.py#L141 https://github.com/carla-simulator/carla/blob/cead6d1b05e89ad84df80984f62daba57bb50e55/PythonAPI/carla/agents/navigation/basic_agent.py#L151-L156

Manifestation:

The only native example where this is used is in the BehaviorAgent tailgating evasion maneuver:

https://github.com/carla-simulator/carla/blob/cead6d1b05e89ad84df80984f62daba57bb50e55/PythonAPI/carla/agents/navigation/behavior_agent.py#L119-L120

In my experiments this is broken as the agent makes a U-Turn to reach a waypoint that is far behind the current location.

Daraan commented 1 week ago

I think this is partially fixed with #7342, the BehaviorAgent will now not longer append the current location to the queue, to which it tries to come back later.

However as the queue is cleaned there is no plan beyond this. This might be similar to the original behavior when set_destination and _tailgating where still in sync but I have not researched this.