Skip to content
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

Disable cameras after fetching images, projection matrix #2881

Merged
merged 2 commits into from
Sep 2, 2020

Conversation

rajat2004
Copy link
Contributor

@rajat2004 rajat2004 commented Jul 26, 2020

Replaces #2465 by doing that internally

Before -

Time spent for 30 frames: 0:00:01.302084
Time spent for 30 frames: 0:00:01.319725
Time spent for 30 frames: 0:00:01.312358
Time spent for 30 frames: 0:00:01.333144
High resolution image captured.
Time spent for 30 frames: 0:00:01.675652
Time spent for 30 frames: 0:00:04.904762
Time spent for 30 frames: 0:00:04.817640
Time spent for 30 frames: 0:00:04.800456
Time spent for 30 frames: 0:00:04.828672
High resolution image captured.
Time spent for 30 frames: 0:00:05.155805
Time spent for 30 frames: 0:00:04.922219

After -

Time spent for 30 frames: 0:00:01.280212
Time spent for 30 frames: 0:00:01.275583
Time spent for 30 frames: 0:00:01.258539
Time spent for 30 frames: 0:00:01.270891
High resolution image captured.
Time spent for 30 frames: 0:00:01.641478
Time spent for 30 frames: 0:00:01.654431
Time spent for 30 frames: 0:00:01.611860
Time spent for 30 frames: 0:00:01.590966
Time spent for 30 frames: 0:00:01.578362
High resolution image captured.
Time spent for 30 frames: 0:00:01.901373
Time spent for 30 frames: 0:00:01.706202
Time spent for 30 frames: 0:00:01.683336
Time spent for 30 frames: 0:00:01.614648
Time spent for 30 frames: 0:00:01.599740
High resolution image captured.
Time spent for 30 frames: 0:00:01.964565

Not sure as to what is causing the still present increase in time, but still much better than earlier
Tested whether disabling camera affects subwindow, no effect
Haven't tested the projection matrix one though

Closes #1766, closes #2389, closes #2464

@WouterJansen
Copy link
Contributor

WouterJansen commented Aug 21, 2020

I just tried this and this improved my camera API retrieval FPS a lot! With 6 camera requests (2 cameras with each RGB/depth/segmentation) at 640x480 I can get 30/40FPS. Were previously it would often cripple to below 10FPS.

I'll do some more testing but so far really nice result.

@rajat2004
Copy link
Contributor Author

Wow, pretty awesome, didn't expect that it would have that much of an effect, the main improvement is apparent when there's a high res camera used infrequently. Thought that this would actually slow down the normal continuous usage a tiny bit.
Thanks for testing!

Related to this, I do hope to get some work done on the other faster_img_capture PR over the next week, after some deadlines this weekend. I think as a last resort might even need to go for separate calls for Vulkan and OpenGL, DirectX. Any suggestions would be great

@madratman madratman merged commit ba4be15 into microsoft:master Sep 2, 2020
@rajat2004 rajat2004 deleted the disable-camera branch September 3, 2020 03:07
rajat2004 added a commit to rajat2004/AirSim that referenced this pull request Oct 7, 2020
…rosoft#2881)"

Running the Image API seems to trigger exceptions

This reverts commit ba4be15.
rajat2004 added a commit to rajat2004/AirSim that referenced this pull request Oct 7, 2020
…rosoft#2881)"

Running the Image API continuously seems to trigger exceptions

This reverts commit ba4be15.
@rajat2004
Copy link
Contributor Author

Follow up, this seems to be causing crashes when using the API continuously, strange that it didn't appear with my testing and others as well. I've opened #3039 which reverts this, but again needs testing to confirm

rajat2004 added a commit to rajat2004/AirSim that referenced this pull request Oct 7, 2020
…rosoft#2881)"

Running the Image API continuously seems to trigger exceptions

This reverts commit ba4be15
saihv pushed a commit that referenced this pull request Oct 8, 2020
…)" (#3064)

Running the Image API continuously seems to trigger exceptions

This reverts commit ba4be15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants