Skip to content
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

Camera crash on trigger timeout #8

Open
ben2789 opened this issue Aug 16, 2018 · 11 comments
Open

Camera crash on trigger timeout #8

ben2789 opened this issue Aug 16, 2018 · 11 comments

Comments

@ben2789
Copy link

ben2789 commented Aug 16, 2018

The driver crashes when the camera times out on a trigger. If set to external triggering, and no trigger is received, the driver crashes. Hard to provide a more detailed description.

[ERROR] [1534454603.501352073]: [SpinnakerCamera::grabImage] Failed to retrieve buffer with error: Spinnaker: Failed waiting for EventData on NEW_BUFFER_DATA event [-1011]
[ERROR] [1534454603.501684359]: Failed to disconnect with error: [SpinnakerCamera::disconnect] Failed to disconnect camera with error: Spinnaker: Can't de-initialize camera. Camera is still streaming. [-1004]

Launch config:

<param name="enable_trigger" value="On" />
<param name="trigger_source" value="Line2" />
<param name="trigger_activation_mode" value="RisingEdge" />
<param name="trigger_overlap_mode" value="Off" />
@mhosmar-cpr
Copy link
Member

Hi @jewnicorn27,
I don't have hardware to test with right now. Would your camera work with flycapture? That feature came from pointgrey_camera_driver which this driver is based on. Could you maybe test with that? It would tell us if its a problem with the new driver.

@ben2789
Copy link
Author

ben2789 commented Aug 20, 2018

@mhosmar-cpr thanks for getting back to me, I am using a BFS camera, which I believe isn't supported by flycapture.

@ben2789
Copy link
Author

ben2789 commented Aug 21, 2018

The source of the issue appears the timeout given to GetNextImage(timeout_) in line 320 of SpinnakerCamera.cpp.

If this parameter is omitted, the default is infinite. This gives me the behaviour I wanted.

@raabuchanan
Copy link

@ben2789 I'm also trying to externally trigger the camera and I applied your fix but it still doesn't respond to an external signal. Could you share your complete launch file and what electrical signal you use for triggering? I've tried 3.3v 25Hz 50% duty cycle from a signal generator.

@ben2789
Copy link
Author

ben2789 commented Nov 14, 2018

@raabuchanan I believe the launch file I use is a simple modification of flir_camera_driver/spinnaker_camera_driver/launch/camera.launch

<launch>
  <arg name="mono_name" value="Blackfly S BFS-U3-16S2M" />
  <arg name="mono_camera_serial" value="17523039" />

  <arg name="calibrated" default="0" />

  <!-- Mono Camera -->
  <group ns="BFS_MONO">
    <node pkg="nodelet" type="nodelet" name="camera_nodelet_manager" args="manager" cwd="node" output="screen"/>

    <node pkg="nodelet" type="nodelet" name="spinnaker_camera_nodelet"
          args="load spinnaker_camera_driver/SpinnakerCameraNodelet camera_nodelet_manager" >

      <!-- Triggering -->
      <param name="frame_id" value="camera" />
      <param name="serial" value="$(arg mono_camera_serial)" />
      <param name="enable_trigger" value="On" />
      <param name="trigger_source" value="Line2" />
      <param name="trigger_activation_mode" value="RisingEdge" />
      <param name="trigger_overlap_mode" value="Off" />

      <!-- Exposure -->
      <param name="exposure_auto" value="Off" />
      <param name="exposure_time" value="40000" />
      <param name="auto_exposure_time_upper_limit" value = "300000" />
      <param name="auto_gain" value="Off" />

      <!-- Use the camera_calibration package to create this file -->
      <param name="camera_info_url" if="$(arg calibrated)"
             value="file://$(env HOME)/.ros/camera_info/$(arg camera_serial).yaml" />
    </node>

    <node pkg="nodelet" type="nodelet" name="image_proc_debayer"
          args="load image_proc/debayer camera_nodelet_manager">
    </node>
  </group>
</launch>

Regarding the triggering signal, I just use a GPIO pin from a 3.3V micro, the pulses were much shorter duration, and lower duty than yours. The exact model of camera is the first argument of the launch file.

@raabuchanan
Copy link

Thanks @ben2789 I realized my issue was using Line0 which is opto isolated and requires a pull up resistor. Using line3 worked for me.

@ben2789
Copy link
Author

ben2789 commented Nov 16, 2018

@raabuchanan I found it easier to work with the BFS camera by modifying the example code rather than editing this driver. If the functionality you're after is fairly simple e.g. no dynamic reconfigure. Adding basic ROS functionality to that may be easier.

@Kaju-Bubanja
Copy link

Why was this closed? The issue still persists at least for me and I see no fix.

@Zebrafish007
Copy link

... GetNextImage(timeout_10) and GetNextImage(timeout_)is raising an error (-1073740791) under PySpin. This also happens with GetNextImage(10), etc....

@ParthAD3
Copy link

ParthAD3 commented Jun 1, 2021

Hi @ben2789
Could you solve this issue?
Image received from camera 20513343 is incomplete.
[ERROR] [1622558664.970472153]: Failed to disconnect with error: [SpinnakerCamera::disconnect] Failed to disconnect camera with error: Spinnaker: Can't de-initialize camera. Camera is still streaming. [-1004]

@ParthAD3
Copy link

ParthAD3 commented Jun 1, 2021

I can launch the camera normally, but after some time this error appears...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants