-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No option to start grabbing with a different strategy #28
Comments
Hi Claudio, are you suggesting to do it configurable, as for example the fps we were discussing in the other issue? I think providing services for this would be a good idea, but maybe just changing to a LatestImageOnly strategy is a best option. What do you think? |
It is probably good to have it configurable with |
Hi Pablo, hi Claudio, as LatestImageOnly (1 buffer in the queue) is a version of LatesImages (one or more buffers, which is freely configurable in pylon), it may be a good idea to implement LatesImages. |
Hi @m-binev, thanks for reaching out here 😄 I'm sorry, I'm not sure I got the point of your comment.
we are covering most (or all?) use cases. |
Hi @claudiofantacci , |
Ok, great. For the record, we use GigE cameras and for me |
Hi, |
Interesting implementation! Thanks for the explanation! |
To follow up: What is a temporary fix to get the FPS as high as Pylon Viewer? Is it by grab strategy modification or is by changing the trigger mode/timeout properties? I have no bandwidth limits (quad channel PCIE card from basler installed). @claudiofantacci I understand you mentioned that "setting grab_timeout_ = and timeout = 2 * grab_timeout_ resulted in very stable performance" in #29 (comment). Have you figured out how to set the framerate based on the yaml file (i.e. using a variable rather than hardcoding it again?). Thanks, |
@m-binev @claudiofantacci Hi, Thanks. I did have a look at your comment and it seems that the software trigger mode set by the ros driver is driving down fps. For anyone that wants to run in continuous acqisition mode refer to this fork that I wrote and tested for USB cameras (Users need to modify accordingly for GigE cameras). Test results show no drop in fps. Thanks, |
@Neel1302 Hi Neel, cool! You seem to have implemented the so called free-run mode (the camera triggers itself automatically), which allows for reaching the maximum possible frame rate (excluding any other possible bottlenecks, of course). Looking at the changes you have made in 'pylon_camera_base.hpp', I am pretty optimistic that a hardware trigger mode can be easily implemented, too. |
@m-binev Thanks! Yes, I agree, that is a good suggestion. Infact, in about 2 weeks from now, I will be adding another set of cameras to my platform's sensor suite requiring hardware triggering due to specific application constraints. I will report/post the link to that modification/implementation here if I achieve success with it. Thanks, |
@Neel1302 Hi Neel, attached I am sending you a hardware trigger configuration based on the software trigger configurator, which is typically located in 'C:\Program Files\Basler\pylon 6\Development\include\pylon' in the pylon installation. |
@m-binev Thanks again. That's great. I will get to testing it in about 2 weeks time. I had a look at the configuration you suggested. I saw the TriggerMode that was set as well as the trigger wait set to FrameStart as well the GPIO input line setting with a parameter for which signal edge to detect as a trigger. For my application, I will be having a PPS input trigger signal at 1Hz from a GPS, but the cameras are to be operating at a higher frame rate: 30 FPS. Thus, I plan to set the triggerName to FrameBurstStart. So essentially for every PPS trigger sent from the GPS, the camera will capture 30 frames. So I understand for the part regarding waiting for the trigger (in the base code), I need to poll FrameBurstTriggerWait. Nonetheless, I think what you have attached will help with getting a head start and I will update after doing some tests. Thanks again, |
Hi Neel, okay, as you seem to have a little more specific setup, you have to addapt/extend the header file according to your needs. But you have nailed it down in principle)) |
Hi @m-binev, The I tried to use the configuration file you sent and placed in As far as I understand, I need to re-build the pylon driver itself. Do you have any idea regarding this? Thanks, |
@Neel1302 Hi Neel, have you added an include with the path to the new header file in "pylon_camera_base.hpp"? It seems the compiler cannot find the header file, because it is a new one to pylon. Regards, Momchil |
Hi @m-binev, you are right with the compiler not being able to find the header file. So what I did was to add: What I am trying to figure out now is why CConfigurationHelper is included. I understand it is to disable compression, but I am not sure if this is a must. Is there a specific directory where this sits as the compiler cannot find it. Update: Assuming that disabling compression is not required, I went ahead and modified the hardware trigger configuration you sent for Frame Burst Triggering and initially it did not work. After some debugging, I found that the culprit was: pylon-ros-camera/pylon_camera/include/pylon_camera/internal/impl/pylon_camera_usb.hpp Lines 95 to 96 in ed094fa
The ROS driver resets the parameters of the camera after the hardware trigger configuration is loaded and thus I was not seeing any image acquisition triggered by the input trigger signal! Perhaps this is why the software trigger mode was set to "On" yet again in the same file despite being specified in the pylon-ros-camera/pylon_camera/include/pylon_camera/internal/impl/pylon_camera_usb.hpp Lines 97 to 99 in ed094fa
See pylon camera reference for The solution is to disable resetting of the camera parameters. Having disabled the two lines refered above (line 95-96), everything started to work as expected. See below for confirmation of the achieved frame rate (in my case a 1Hz signal is sent into GPIO Line3 and Thus it seems that with these additional changes, the hardware configuration you suggested does work and I have confirmed that experimentally. Thanks again for your help and I hope this can help develop the ROS driver further and include these triggering features (potentially through the config file directly), |
Hi @Neel1302 , that is positive news - great)) |
Hi @Neel1302, thank you for your implementation! Could you do a Pull Request to devel? I can test it here and then merge it. Cheers |
Hi @m-binev, Thanks again for the support as well. @pablo-quilez I did create a pull request and I hope that can be merged into the basler ROS driver after your test. At large, I hope it can help other ROS users take full advantage of the camera features. Here is a link to the fork for the hardware trigger branch that I have implemented for anyone to use, i.e. until the pull request for this is tested and merged. Thanks, |
Hello, we have tested and merged the #56 which adds the possibility to choose the grabbing strategy as well as the timeout. @Neel1302 my colleage checked your PR and thanks for the contribution, but we cannot merge it directly, only use it as guide to add the hardware trigger as option. I will keep the issue open and the PR. Cheers, |
@pablo-quilez I am happy that my contribution can help users in need of this feature. If there is specific reason why it cannot be merged directly, let me know and I can try to see how I can help as I do think for uses cases such as in autonomous driving and machine vision, the hardware triggering feature is essential, especially given most basler cameras support this feature. While this is under implemention, I hope my fork implementing this functionallity can help those that require it. Thanks, |
Hi, I have a similar problem, can you look at this question? |
The current implementation of the camera driver uses the following function call to start grabbing
with default parameters, i.e. calling
Pylon::CInstantCamera::StartGrabbing()
in diffeernt part of the code, see for example
pylon_camera/include/pylon_camera/internal/impl/pylon_camera_base.hpp
.However this implies that, for real-time applications, if a frame is not grabbed (e.g. a trigger fails) a queue with past frames is formed, resulting in an synchronized grabbed sequence of images. This may be desirable in some applications, but the dirver/ROS node should provide a way to choose the best strategy, which are
enum Pylon::EGrabStrategy
GrabStrategy_OneByOne
GrabStrategy_LatestImageOnly
CInstantCamera::RetrieveResult()
, the processing waits for the upcoming image.GrabStrategy_LatestImages
CInstantCamera::OutputQueueSize
parameter can be used to control how many images can be queued in the output queue. When setting the output queue size to 1, this strategy is equivalent toGrabStrategy_LatestImageOnly
grab strategy. When setting the output queue size toCInstantCamera::MaxNumBuffer
, this strategy is equivalent toGrabStrategy_OneByOne
.GrabStrategy_UpcomingImage
CInstantCamera::RetrieveResult()
method a buffer is queued into the input queue and then the call waits for the upcoming image. The buffer is removed from the queue on timeout. Hence after the call to theCInstantCamera::RetrieveResult()
method the input buffer queue is empty again. The upcoming image grab strategy cannot be used together with USB camera devices.The text was updated successfully, but these errors were encountered: