ROSIntegrationVision icon indicating copy to clipboard operation
ROSIntegrationVision copied to clipboard

very low framerate

Open AdronTech opened this issue 6 years ago • 4 comments

I would like to use ROSIntegration and ROSIntegrationVision for my Bachelor Thesis but i encountered the problem that i get very slow framerates.

I run the whole setup by running Unreal with the plugin on Windows and ROS in the WSL. When i change the framerate of the VisionActor for eg. to 20 it never reaches this framerate and also the whole framerate of the game/simulation decreases to 5-10 FPS. It should not be a problem of not heaving enough resources to render the scene because when i let it run without the plugin the game runs on 50-60 FPS and it does it so when i add a second camera manually.

Do you have any suggestions on how i could increase the framerate without reducing the resolution.

I took also a look at it with the profiler and discovered that the cpu stalls a lot. I will have to investigate into that.

AdronTech avatar Aug 25 '19 20:08 AdronTech

Hi! Nice to see someone using that for his thesis :)

In our works we never needed higher frame rates, so we didn't optimize the Plugin for speed. Internally, the Plugin uses a double buffering technique. Maybe the reading and writing there is not optimal which will cause long wait times and your cpu to stall. Critical might also be the maximum possible throughput on your network interface, as the whole data is send uncompressed.

Sanic avatar Aug 26 '19 09:08 Sanic

@AdronTech, I added a flag called UseEngineFramerate to VisionComponent which will update the RGBD topics every tick.

I also recommend packaging your game / sim as in-editor runs have a lower frame rate.

Tim-Fronsee avatar Jan 10 '20 01:01 Tim-Fronsee

I have the same problem, it is slowing UE4 even if i don't ask for high framerates ! any new ideas since ?

bilelxlab avatar Oct 18 '21 18:10 bilelxlab

I changed the Framerate(1) to Framerate(100)in VisionComponent.cpp and I was surprised to find that the FPS improved.

UVisionComponent::UVisionComponent() :
Width(640),
Height(480),
Framerate(100),    // change 1 to 100
UseEngineFramerate(false),
ServerPort(10000),
FrameTime(1.0f / Framerate),
TimePassed(0),
ColorsUsed(0)

pisces365 avatar Nov 17 '22 03:11 pisces365