basler / pylon-ros-camera

The official pylon ROS driver for Basler GigE Vision and USB3 Vision cameras:
http://www.baslerweb.com
Other
144 stars 144 forks source link

Actual framerate is lower than the expected one! #139

Closed Xyneef closed 1 year ago

Xyneef commented 1 year ago

Hello everyone I am using a Basler acA4112-30 um with ROS Noetic.

I set up the camera in Pylon Viewer to reach the maximum framerate possible of the camera, which is 30 FPS. I even disabled the device throughput limit to squeeze some extra speed up to 30.9 FPS. On Pylon Viewer I have the best possible configuration for my application, and I saved that configuration in the UserSet1.

On ROS Noetic, I start up my camera using the standard launch file and I modified the standard "default.yaml" file by having the following lines:

_image_encoding: "mono8" startup_userset: "UserSet1" (which is where I saved my configuration in Pylon Viewer) _grab_strategy: 0 framerate: 60.0 (I do this to ensure I get the maximum framerate possible because it caps anyways) _exposure: 33000 white_balance_auto: 0 shuttermode: "global"

The terminal where I run the launch file tells me _"Desired framerate 60.00 is higher than the max possible. Will limit framerate to 30.10 Hz " "Start image grabbing if node connects to topic with a framerate of: 30.096 Hz"

So it looks like everything is fine, but then when in another terminal window I run _rostopic hz etcetc/imageraw I see a frequency no higher than 16 Hz. At the moment of writing this post I am getting 13.6 Hz .

I thought it was a fluke so I recorded the image_raw topic in a bag file with a limit of 120 messages. If the camera was working at 30 Hz the bag file would last 4 seconds, but when I run rosbag info , the duration of this bagfile is 8.6 seconds. So the camera is working at less than HALF its supposed speed. To add insult to the injury, _rosparam get etcetc/framerate returns 30.096 Hz !

Can anyone tell me what's going on? Is there a way to get ROS to give me the frame rate it's supposed to give me?

FrancoisPicardDTI commented 1 year ago

Hello @Xyneef Check as well what kind of triggering you are using. When using software trigger, the frame rate may be decreased by 50%. That is why, you should either use free-run (no explicit external triggering), or external hardware trigger. This topic was discussed in different other issues already and there were implementations for that. Try as well setting the parameter _enable_current_paramspublisher for the node to false? It seems that the publishing of the parameter significantly slows down image publishing.