carla-simulator / carla

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

RuntimeError: time-out of 2000ms while waiting for the simulator, make sure the simulator is ready and connected to 127.0.0.1:2000 #3430

Closed akshatamk closed 3 years ago

akshatamk commented 4 years ago

Hello, I'm getting this error while running the python API in CARLA. I tried changing time-out duration as well as port number, but still the same issue. Please help

tinmodeHuang commented 4 years ago

just now I have ran into same error and had no idea how to solve it as well, however, I can perform spawn_npc.py successfully after changing into newest edition

jackbart94 commented 4 years ago

Hi,

Could you tell us more about this, for example the steps you are taking to execute CARLA? Are you running it in Unreal Engine, or in the package version?

akshatamk commented 4 years ago

Thanks for the response. yes i'm running CARLA in unreal engine 4.24x.The simulator is opening but unable to run the example APIs.

jackbart94 commented 4 years ago

Did you press the Play button (or alternatively Alt+P) after launching Unreal Engine, before running the scripts? Because I've only seen this error when you forget to do so.

akshatamk commented 4 years ago

I have installed DirectX, Nvidia drivers and trying to set up CARLA on azure Windows VM (NC6s_V3-Tesla K80), does this environment support Unreal engine(as CARLA runs on unreal engine)? or should be configured on GeForce graphics ? Because i'm getting the error as "DX11 feature level 10.0 is required to run the engine" while launching unreal engine.

nagasanjay commented 4 years ago

Did any one of you deleted the contents of config folder to load CarlaEditor fast ?

Because I did that and ran into similar issue. I solved it by downloading the config files again and putting it in config folder.

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.

germanros1987 commented 3 years ago

Issue closed due to lack of activity. Feel free to open a new issue if you still consider this is a critical matter.

omkarshinde22 commented 3 years ago

facing the same issue

by-seong-me commented 3 years ago

Before run python script, you should run server. In my case, something like this, $ ./CarlaUE4.sh /Game/Maps/Town01 -carla-server -benchmark -fps=15 -windowed -ResX=800 -ResY=600

And then, you can run python script in python example directory $ python3 manual_control.py

narayanaraju10 commented 3 years ago

Hello guys, recently while working with carla in python I used to get this error "RuntimeError: time-out of 2000ms while waiting for the simulator, make sure the simulator is ready and connected to 127.0.0.1:2000". This problem can be due to carla is not loading in 2000ms. in my case, i moved to higher GPU and RAM pc now its working fine and carla is loading with in 2000ms.

if you are stuck with same pc, kindly increase to pc to performance mode.

Best, Narayana

omkarshinde22 commented 3 years ago

Resolved this issue. Way to solve this issue. If you are using windows then please check your directx. Presently microsoft took off directx from its official website. But you can download it from third party. Else you can increase the ram and rerun the Carla simulator.

narayanaraju10 commented 3 years ago

change the time in "client.set_timeout(2.0)" in the code to "client.set_timeout(200.0)" # 200 depicts the loading time.

Best, Narayana

egamor18 commented 3 years ago

I had the same issue and solved it in the Unreal Engine Editor by going to Edit ->Editor preferences ->Performance and disabling Use less CPU when in background

pinnintipraneethkumar commented 3 years ago

Hello guys, recently while working with carla in python I used to get this error "RuntimeError: time-out of 2000ms while waiting for the simulator, make sure the simulator is ready and connected to 127.0.0.1:2000". This problem can be due to carla is not loading in 2000ms. in my case, i moved to higher GPU and RAM pc now its working fine and carla is loading with in 2000ms.

if you are stuck with same pc, kindly increase to pc to performance mode.

Best, Narayana

Hii May i know the what is your pc specifications. Thanks.

josephzha commented 3 years ago

Hello guys, recently while working with carla in python I used to get this error "RuntimeError: time-out of 2000ms while waiting for the simulator, make sure the simulator is ready and connected to 127.0.0.1:2000". This problem can be due to carla is not loading in 2000ms. in my case, i moved to higher GPU and RAM pc now its working fine and carla is loading with in 2000ms.

if you are stuck with same pc, kindly increase to pc to performance mode.

Best, Narayana

I changed the timeout to 5 seconds and it worked.

nikhilkalghatgi commented 3 years ago

Hello guys, recently while working with carla in python I used to get this error "RuntimeError: time-out of 2000ms while waiting for the simulator, make sure the simulator is ready and connected to 127.0.0.1:2000". This problem can be due to carla is not loading in 2000ms. in my case, i moved to higher GPU and RAM pc now its working fine and carla is loading with in 2000ms. if you are stuck with same pc, kindly increase to pc to performance mode. Best, Narayana

I changed the timeout to 5 seconds and it worked.

Can you please tell in which file you increased the timeout?

josephzha commented 3 years ago

client.set_timeout() look for this in which ever file you are running

manju838 commented 3 years ago

Thanks @narayanaraju10 ,it worked for timeout as 5.0.Mine is a 2GB Graphics card and 2.0 time didn't work.Better the graphics,lesser timeout needed

DonadiHarshith commented 3 years ago

Hi,

Could you tell us more about this, for example the steps you are taking to execute CARLA? Are you running it in Unreal Engine, or in the package version?

I am using package version can you help me

shsrinivgit commented 3 years ago

Did you press the Play button (or alternatively Alt+P) after launching Unreal Engine, before running the scripts? Because I've only seen this error when you forget to do so.

THANKS. I JUST WASTED TIME REBUILDING THE CARLA AND FOUND THIS HELP. SAVED A LOT OF TIME

e-Dylan commented 2 years ago

tl;dr: If it was open and working before you closed it, end the background process in task manager before you re-run the UE4 exe.

I just got this issue when I opened the CarlaUE4.exe unreal executable for carla, closed it, and tried to re-run it. I didn't realize the first one I had closed was still running an open process only visible in task manager. Once I found it in task manager (takes like 4gb memory but no cpu, not hard to find) and ended the task, api commands worked again after re-running the executable.

gaooogao commented 2 years ago

I downloaded the 0.9.13 version of Carla, and it unzipped, installed, and worked fine. I saw Carla’s emulator. And opened the Python script. Operational. Then I shut down the Python.Carla was shutting down before I quit Python. Running Carla again, Carla is normal, but this error occurred while running the Python script. Turn it off. We can’t do it again.

The Solution:

Find the File Explorer, and force the termination of the software (Carla, Python, Annaconda)

Then restart Carla and execute the Python script. My problem is solved.

RocaPiedra commented 2 years ago

tl;dr: If it was open and working before you closed it, end the background process in task manager before you re-run the UE4 exe.

I just got this issue when I opened the CarlaUE4.exe unreal executable for carla, closed it, and tried to re-run it. I didn't realize the first one I had closed was still running an open process only visible in task manager. Once I found it in task manager (takes like 4gb memory but no cpu, not hard to find) and ended the task, api commands worked again after re-running the executable.

Hey, if you are using Windows and you randomly encounter this issue (for me it started happening right after performing some tests successfully, after restart it worked fine), this is the way to solve it! Thanks for the info, Dylan

Pratham544 commented 2 years ago

tl;dr: If it was open and working before you closed it, end the background process in task manager before you re-run the UE4 exe.

I just got this issue when I opened the CarlaUE4.exe unreal executable for carla, closed it, and tried to re-run it. I didn't realize the first one I had closed was still running an open process only visible in task manager. Once I found it in task manager (takes like 4gb memory but no cpu, not hard to find) and ended the task, api commands worked again after re-running the executable.

tl;dr: If it was open and working before you closed it, end the background process in task manager before you re-run the UE4 exe.

I just got this issue when I opened the CarlaUE4.exe unreal executable for carla, closed it, and tried to re-run it. I didn't realize the first one I had closed was still running an open process only visible in task manager. Once I found it in task manager (takes like 4gb memory but no cpu, not hard to find) and ended the task, api commands worked again after re-running the executable.

Thanks a lot, I tried increasing the timeout but it didn't work. Then i did this and it started working.

RocaPiedra commented 2 years ago

This issue happens in both Linux and Windows. In my experience, it mostly happens when you try to close the Carla Server from the application/script used. This is very annoying as I'm trying to create sort of an app that is self-managed (including Carla Server). I launch the server through a Python subprocess and end the subprocess when execution is finished but here is when the background process is an issue. Does anybody know how to end the Carla Server cleanly?

winterwindwang commented 2 years ago

Same issue solved by increasing the timeout(2->10) of client.set_timeout(timeout)

Kenneth71-P commented 2 years ago

When I had the same problem, I entered task manager and ended CarlaUE4 app. Then it solved the problem.

amirBgazand commented 1 month ago

I had the same issue, and every time I get to this problem I just change the port to 3000, and amazingly, it works well. just run the carlaUE4 by CarlaUE4.exe -carla-rpc-port=3000 and in your code change the port to 3000 client = carla.Client('127.0.0.1',3000)