Git Product home page Git Product logo

Comments (9)

STARKEY13 avatar STARKEY13 commented on August 24, 2024

The default timeout of 10 seconds might not be sufficient when using multiple cameras. Increase the timeout to give the simulator more time to process the requests

from carla.

LeonardMendicantBias avatar LeonardMendicantBias commented on August 24, 2024

Thank you for the quick response. Unfortunately, the error persists. I modified the following.
client.set_timeout(50.0)
The simulations simply wait 50 seconds before showing the same error.

One more "anomaly", I switch the simulation to async mode and everything works. However, this would not do since I need the synchronous mode.

from carla.

PatrickPromitzer avatar PatrickPromitzer commented on August 24, 2024

Hi,
the "time-out" error happens if Carla didn't answered.
It could be the connection, Carla crashed, Carla took too long, or everything else that could prevent a answer from the server in the timeout limit.

You can try to add some debug messages to see where the script got an error.
Did the Server still run after the time-out error?

btw. the code is hard to read because of the formatting. You can use

   ```python
    code
    ` ` `

to keep the format. (without space)

from carla.

LeonardMendicantBias avatar LeonardMendicantBias commented on August 24, 2024

@PatrickPromitzer Thank you for the coding quote tips. I did not know about triple ```. The github's editing tool only shows single `. I edited the code for future reading.

The UE 4 editor is running while the script is waiting for a response! After the time-out message, I can still move around in the UE 4 editor (using WASD). However, If I start the script again, the script returns the time-out message without the initial images. I think that using 4 cameras crashes the Carla server and prevents later connections. If I close the UE 4 editor and reopen it, the script still cannot find the Carla server. Does that mean the Carla server still running and the reopened UE 4 editor started another server? Since the UE 4 editor is still "functional", I really don't know where to debug. Do you have any suggestion where should I watch for a possible bug?

p/s: I start the UE 4 editor in the folder "./Unreal/CarlaUE4/CarlaUE4.uproject" after I finished build Carla from source.

from carla.

PatrickPromitzer avatar PatrickPromitzer commented on August 24, 2024

Normally, if the server crashes the unreal editor crashes, too. (maybe only on Ubuntu)
You could search if an old instance is running and close everything Carla related.
It is not a solution, but maybe something in the background is creating a problem.

You could look if your firewall is blocking something.

You could try making a package and test it with that package.

One thing that helps for me is adding "world.tick()" in between adding sensors or listeners.

You could try using one blueprint instance for each camera (just to be sure, even if should not make a difference)

You can watch your CPU/GPU usage, too.

For

camera_1.listen(lambda image: image.save_to_disk(f'{args.directory}/camera-1/{image.frame:06d}.png'))

you could call an custom function and log the function call.

with open("log_file.txt", "a") as f:    
    f.write("Function call: {0}".format(camera_name))

Maybe I come up with more ideas at a later time.

from carla.

LeonardMendicantBias avatar LeonardMendicantBias commented on August 24, 2024

@PatrickPromitzer Thank you so much for your suggestions. My firewall has been turned off. I do have a defined function for the callback.

I don't know what I have changed, but somehow the script works. I mark this as solved but I really don't know what was the problem.

from carla.

LeonardMendicantBias avatar LeonardMendicantBias commented on August 24, 2024

I found the problem. It is the sensor_tick. When I set the value too low (i.e., 0.02 for 50 fps), the simulator time-out while it works well with sensor_tick=1. I guess I need a better computer.

from carla.

PatrickPromitzer avatar PatrickPromitzer commented on August 24, 2024

The normal tickrate is 0.1, and at some point, the documentation said you should not go below 0.05

Try which rate works for you before buying new hardware.

from carla.

LeonardMendicantBias avatar LeonardMendicantBias commented on August 24, 2024

Yes, the document states that the simulation should not be less than 10 FPS (0.01) or the physic would get weird. But sensor_tick is the update rate of the camera, not the simulator itself.

Also, I am able to utilize sensor_tick=0.02 by adding the image into a global queue in the callback function. Then, after the world.tick(), I save the queued images. This makes the simulations not real-time anymore, but that does not matter since I only need the synthetic data.

from carla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.