magazino / pylon_camera

ROS-Driver for Basler Cameras
BSD 3-Clause "New" or "Revised" License
78 stars 108 forks source link

CPU Usage #36

Closed flajolet closed 6 years ago

flajolet commented 6 years ago

Hello,

Thanks for this great package!

I have run some tests to compare the CPU usage of the official pylonViewer and pylon_camera when grabbing images at a constant fps with a GigE camera. The difference is quite significant, see procedure and results below. What is causing such a difference? Could it be because "the default node operates in Software-Trigger Mode" in pylon_camera?

Settings (same settings for pylonViewer and pylon_camera): Host computer: Ubuntu 16 kernel v4.4.0-generic Network setup: Basler plugged straight into the ethernet port using a POE injector NIC of the host computer: Intel I217-LM Model: Basler ace GigE Image encoding: BayerRG8 MTU: 9000 (set both on the camera and on the NIC of the host computer) FPS: 15 Inter-packet delay: 0

top reports a CPU usage of:

flajolet commented 6 years ago

I figured it out: the raw image is rectified even if no one is listening to the rectified topic when the camera info is provided.

NikolasE commented 6 years ago

Great find, you are right, this should be disabled, if the rectified image is never used. We need to find a solution that works for the streaming interface (via topics) as well as the action-based interface.

flajolet commented 6 years ago

cv_bridge_img_rect_ does not seem to be used at all by the action-based interface so it seems that it would be possible to simply move this section right before publishing the rectified image in the same if scope without impacting anything else.

marc-up commented 6 years ago

Thanks! You're right, I'll push your proposed fix soon.