-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera frame rate for capturing images is exceptionally low #2891
Comments
Low frame rates are definitely a problem. Just some general ideas on improving it Try using binaries, I've generally found that binaries are faster than running in Editor. Not sure if you're already using them, for your custom env or even the normal ones, once you have any changes in Airsim (such as the fetching the latest master) tested and working, packaging the project is pretty easy. See UE4's page, there's also a setting Full Rebuild you would want to disable if packaging frequently. First time packaging will take time though You aren't using a high-resolution camera infrequently from the description, if you were, then trying out #2881 would be a very good thing. But mostly not applicable here There's another PR #2713 which has some binaries linked you can try, that improves FPS quite a bit, but crashes. And currently, Depth images aren't working, need to spend some time on that As discussed int the other issue #2892, maybe see if using uncompressed images helps
Do you have a settings file which I can try out? |
Here are the contents of my settings file:
Just want to go over the points you mentioned:
Also, I just found that the performance does improve a bit if I build the lighting. I hadn't built it for some time, so maybe there is some benefit to building it before testing.
I suppose one other performance improvement might be to separate the image request and the saving of the png into separate threads. I notice a decrease in the speed when I have these in sequential order. Should actually be pretty similar to the usual issue with getting the video from a webcam using opencv. |
Also, strangely now when I try with PR #2713, I get an error when trying to convert the uncompressed into a numpy array (base) C:\Users\eia-l\Documents\SoftwareProjects\AirSim\PythonClient\computer_vision>python test_numpy.py Len: 2764800, height: 800, width: 864 And when I try to request and record the compressed image, even though it saves the image cannot be open, because the file format is supposedly unsupported This worked for me before when I tried on a linux machine using opengl, but on my windows machine now it is not working. I didn't use opengl on windows |
Oh yeah, sorry, the PR changes the format from RGB to RGBA, so for reshaping you'll need to use |
Okay, thanks for the heads up. That allowed me to test with it. |
I'm also seeing slow image capturing, with +-5 Hz @ 480p for both OpenGL and Vulkan. @rajat2004 I'm trying your suggestion of packaging the binaries in Linux, but I can't seem to get it working. I followed AirSim's guide, and have also tried using the ue4cli to no avail. I can compile everything by when trying to run the resulting
I'm using the following versions: |
@clintlombard You're getting 5Hz at 480p? That's too low |
This issue has been automatically marked as stale because it has not had activity from the community in the last year. It will be closed if no further activity occurs within 20 days. |
I have recently been testing Airsim + Unreal on a gaming desktop to see if I can get better performance than what I was able to get on a laptop. For reference, this is the desktop:
Alienware Aurora Ryzen™ Edition R10 Gaming Desktop
https://www.dell.com/en-us/shop/cty/pdp/spd/alienware-aurora-r10-desktop/wdryzr10mx?configurationid=8e4e7c7e-3794-4eef-abb4-173cdc0a3004
As part of my work, I am interested in flying a drone along a pre-programmed path, with the images from the cameras being captured at a high frame rate, ideally 30fps, which would recreate the video feed of a camera attached to a real drone. I am using this video for evaluation of different VSLAM/VO/VIO algorithms in the simulated environment with the goal of validating an approach before deploying it to a real environment. I have a stereo camera pair instantiated with individual resolutions of 848x800.
The issue I am having is that despite trying multiple different approaches, the only way I can get a decent frame rate of image capture is by running the simulation at a very low clock speed, like 0.1. I have tried using the built in recording tool in the Unreal editor, and even some custom python scripting which will record the pose of the robot and the camera image, so that I have ground truth information for each recorded frame.
My current simulation approach looks like this:
responses = client.simGetImages([
airsim.ImageRequest("front_left_custom", airsim.ImageType.Scene, False, True),
airsim.ImageRequest("front_right_custom", airsim.ImageType.Scene, False, True)])
What I am seeing right now is that the performance of this logging program doesn't improve much, even when run on more powerful hardware. I would have expected with enough CPU, GPU, and RAM available, and with no display showing, that the image capture could run close to real time at a high frame rate.
Is there maybe something I am missing here? I have seen similar performance when trying to get the images over ros topic too. This is very easily done in gazebo so I am surprised that I am having so much trouble with airsim, which I expected to be much better. I took a scan of the issues on git and I am seeing some others mentioning similar issues.
The text was updated successfully, but these errors were encountered: