ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Performance issue with librviz and multiple RenderPanels

asked 2013-11-13 02:23:18 -0600

Felipe Bacim gravatar image

I'm developing an application that uses one instance of librviz but has multiple render panels. It's initialized in the same way as the camera display, in which the VisualizationManager instance is shared among all render panels. Currently, the application uses a single window with four render panels, each one with a different camera. In my tests, I only have the robot model active, which currently has a total of 90K triangles.

Now, the issue that I have is related to poor rendering performance. More specifically, windows are rendered sequentially inside the renderOneFrame() function call in VisualizationManager::update and basically rendering performance is divided by four in comparison to only using a single render panel (it goes from ~0.017s to complete renderOneFrame() to ~0.065s). This is expected when there's a lot of geometry to be rendered, but the difference in performance when rendering 90K and 600K triangles per window is minimal (drops from 15FPS to 14FPS per window).

I've tried an alternative to this, opening four different windows in separate processes, each window having its rviz instance with a single render panel (equivalent to opening rviz four times). Performance goes back to where it was when I only had one render window, which means performance is not limited by the GPU and rendering itself, but by CPU operations done inside renderOneFrame(). What's even more interesting is that CPU usage drops from around 80% with one render panel to 50% with four render panels and shared VisualizationManager instace. Of course, CPU/memory usage is multiplied by four if I have four separate windows since I have to process/store the same data four times, and the only difference between the four windows is the camera position, so this would be a less than ideal solution.

Since GPU is not what's limiting performance here, I believe there's something happening in the pre-render/post-render function callbacks that's causing this. Keep in mind that these will run once for each camera/viewport (that's how renderOneFrame is implemented), so if there's something blocking execution once per frame in these callbacks when there's only one render panel, it will block execution four times per frame when there are four panels. I'm not sure if it's waiting for TF or something else.

So, anyone else experienced this? Any tips/suggestions of what the problem might be or how to fix it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-16 09:45:26 -0600

dgossow gravatar image

The camera displays have some callbacks registered to set the visibility flags and to hide the image texture in the main view. Also, all render panels need to do view frustum culling on the cpu. That would be my first guesses as to where the performance drops come from.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-11-13 02:23:18 -0600

Seen: 388 times

Last updated: Nov 16 '13