neufieldrobotics / spinnaker_sdk_camera_driver

Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)
MIT License
125 stars 91 forks source link

Fix ros::Rate issue #121

Closed mrmouss closed 2 years ago

mrmouss commented 3 years ago

Fix an issue when the parameter soft_framerate is set to 0. In this case we would create an object ros::Rate ros_rate(0) which is not allowed and the node would crash. The fact that we create the object with argument 1.0 or any other argument won't matter when SOFT_FRAME_RATECTRL is set to false, which is the case when soft_framerate = 0, won't matter as we wouldn't enter the if condition if (SOFT_FRAME_RATECTRL), so we won't sleep.

ghost commented 3 years ago

@mbennehar, we shouldn't be in this function if you set SOFT_FRAMERATE off. The use case for that would be use the MAX_RATE_SAVE option. We use software triggering since it is the only way we found that works reliably with multiple cameras without going out of sync. If you are looking to do higher rate, take a look at the MAX_RATE_SAVE option. So by design a rate should not be used when you are not using SOFTFRAMERATE.

What is the desired behavior that you are trying to achieve?