Closed erikasnow closed 4 years ago
Also have there been issues on synchronization of camera_info and image_raw topics? This will cause problems when sending to image_proc part of image_pipeline
@erikasnow Which branch are you using (master, dev)? We tested the code on Blackfly s cameras, where we do acquisition in continuous acquisition mode. There are couple of ways to trigger:
The way to export images to ros mimicking third option(fixed frame rate) would be: set, max_rate_save to 'False'(default)
comment lines in 656-659 and add
cams[i].setEnumValue("LineSelector", "Line2");
cams[i].setEnumValue("LineMode", "Output");
// cams[i].setBoolValue("AcquisitionFrameRateEnable", false);
cams[i].setFloatValue("AcquisitionFrameRate", 30); // in your case
which will set camera to output images at fixed frame rate, now images are triggered on device instead of software or external hardware trigger.
Now, we need to change the code in lines 894, 934, 960 to comment the software triggering. so it just grabs images when available.
comment lines with
cams[MASTER_CAM_].trigger();
Finally comment line 999, to remove sleep, grab_mat_frame() actually waits till a frame is available in buffer with a timeout of 2 sec.
I hope this setup should work, I haven't compiled or tested it.
Regarding sync issue, we use imagetransport camerapublisher which published image msg and info msg at same time and timestamps on msg headers of img_raw and cam_info are same. Its in line https://github.com/neufieldrobotics/spinnaker_sdk_camera_driver/blob/15803f032859341b2d1740dbce5300726b2ac8b8/src/capture.cpp#L792
can you tell me the steps you followed to reproduce the error.
If you have recorded images with rosbag with fixed buffer size, you might have dropped couple of msgs and that might be a reason for the issue. try recording with -b 0 in rosbag record.
Have you tried to subscribe using msg filters like in image_proc and does it throw warnings of mismatch. Also try with imagetransport camerasubscriber() instead of Subscriber() or imagetransport subscriber()
http://docs.ros.org/melodic/api/image_transport/html/classimage__transport_1_1CameraSubscriber.html
Thanks for your input! I compiled changes for fixed frame rate. No compile errors, but this error showed up on launch.
[FATAL] [1575400115.453809910]: Unable to set AcquisitionFrameRate to 30 (ptr retrieval). Aborting... [FATAL] [1575400115.454385873]: Error: Spinnaker: GenICam::AccessException= Node is not writable. : AccessException thrown in node 'AcquisitionFrameRate' while calling 'AcquisitionFrameRate.SetValue()' (file 'FloatT.h', line 83) [-2006] [ WARN] [1575400115.454478533]: Most likely cause for this error is if your camera can't support color and your are trying to set it to color mode terminate called after throwing an instance of 'Spinnaker::Exception' what(): Spinnaker: Failed waiting for EventData on NEW_BUFFER_DATA event. [-1011]
@mithunvarma
Thank you for your reply above. We are trying to use a hardware trigger for this device, and you mentioned we need to change something in the dev branch. Would you kindly tell me how should I change this?
Thank you for your time and effort.
Best, YZ
@yzhou377 you question seems unrelated to this issue. Can you open up a separate issue please with details on what you are trying to do.
Not sure if the issue is still relevant for topic starter, but future user: note that to make @mithunvarma advice (fixed frame rate to ROS) work.
cams[i].setBoolValue("AcquisitionFrameRateEnable", false);
line should be uncommented and set to true
.
That work for me.
What parameters do you change in the driver node to slow framerate? Changing the soft_framerate parameter causes the output raw image to delay images, not actually reducing frames from camera. Using the Flir Firefly S that outputs at 60 FPS. Trying to output at 30 FPS without any delay to the images.