Carla: Path planning using Autopilot mode

Created on 4 Nov 2019  路  13Comments  路  Source: carla-simulator/carla

How could I use the autopilot mode to drive the vehicle from start spawn point to end spawn point on CARLA maps?
In other words, how to do path planning from source to destination spawn points using autopilot mode to avoid obstacles and obey traffic signs?

Most helpful comment

@OmarElzaafaranyBrightskies
Currently, the autopilot mode only supports the default random route, it cannot be configured to a specific route, though it can avoid obstacles and obey traffic rules.
For driving on a specific route, you have to design your own agent to achieve it.

All 13 comments

Have you checked automatic_control.py and the relative python scripts it uses?

Yes, I have checked it. I could produce a route that has spawn points from a start point to the destination point in the shortest path using A* algorithm. However, I couldn't put the car in an autopilot mode between source and destination so It can avoid obstacles and obey traffic rules.

@OmarElzaafaranyBrightskies
Currently, the autopilot mode only supports the default random route, it cannot be configured to a specific route, though it can avoid obstacles and obey traffic rules.
For driving on a specific route, you have to design your own agent to achieve it.

There is actually a pull request for a behavior agent which doesn't use the autopilot but avoids obstacles, obeys traffic rules and much more. However, it might need some tuning and it's a bit WIP for the latest features, but it can be a good starting point.

Thanks @xmyqsh for your clarification.
Thanks @jackbart94, I will check the behavior agent. I have tried it and it works fine for one player vehicle. Could I add multiple player vehicles?

Sure, just launch multiple instances in different terminals!

When I tried to launch multiple instances (precisely 2) in different terminals, I found that the vehicles' behaviors become inaccurate. They either couldn't follow the red crosses or crash into the nearby walls.

Just tested - not really happening to me. Could you provide proof and more information?

EDIT: Could also be due to your computer's specs, a too low FPS value would mess up the control.

I have recorded my screen, here is a link.
You could find that the vehicles (vehicle and bike) crashed in the wall at the end. This is not the case when one instance is running.
https://drive.google.com/file/d/1v2BEHR3HBCOAecRE3HBtLIan-eIgNaSy/view?usp=sharing

Here are the specs of my Dell Inspiron 15 7000 Gaming Laptop:
NVIDIA GeForce GTX 1050
Powerful 7th-generation Intel Quad-Core i7-7700HQ 2.50 GHz with Turbo Boost Technology up to 3.80 GHz
16GB DDR4 2400MHz Memory,

Thanks for your time.

Yep, it's the FPS, 10 is too low. You can try changing the FPS value (local_planner_behavior.py, line 50) from 20 to 10 but that will hardly help probably. Unreal runs on veeery high specs.

Also, run it with --filter vehicle.audi.a2 (for example) or any other "safe" vehicle to avoid spawning bikes or stuff that you might not be interested in. There are a few other flags you can play with.

Thanks very much.
Still the same issue even at various FPS values (100, 40, 20, 10, 1), It seems because of my laptop specs.
I could now close the issue.
Thank you for your precious time.

@jackbart94 @OmarElzaafaranyBrightskies
First, dt is determined by FPS, so, we'd better set it around 20(local_planner_behavior.py, line 50), assuming the current PID parameter is good enough.
Second, for different type of vehicles, they should have their own PID parameter sets.
Third, I have found some corner cases that is not perfectly handling. And the PR #2216

I do agree we might need different sets of PID parameters but probably not for every vehicle. Also, I've answered to your PR, we can continue discussing eventual changes there! Thanks for your help and time! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kk2491 picture kk2491  路  3Comments

rowanmcallister picture rowanmcallister  路  3Comments

hc167 picture hc167  路  4Comments

robertnishihara picture robertnishihara  路  4Comments

cstamatiadis picture cstamatiadis  路  3Comments