srv / avt_vimba_camera

ROS Driver for AVT cameras using VIMBA SDK
23 stars 93 forks source link

Crashed after dynamic reconfigure #28

Closed samuel-ongzx closed 6 years ago

samuel-ongzx commented 6 years ago

Hello Guys,

Did anybody face any issue with the Dynamic Reconfigure portion of the camera driver? I am currently using a Mako-G131C camera. I tried to narrow down the problem, it seems that MonoCamera::configure in mono_camera.cpp is called successfully, which also means that the updateConfig in avt_vimba_cpp works well too.

Any help would be greatly appreciated, please let me know if you need anymore information from me. I'm currently running ROS Indiego.

Thanks!

Samuel

samuel-ongzx commented 6 years ago

However it does seems that the cam_.updateConfig(newconfig); is causing the camera crash. Once I commented it out, the process isn't killed, but of course there's no update to the parameters as well. Futhur narrowing down shows that it is due to the startImaging(); in the updateConfig function.

I think I have narrowed it down to this problematic line:

VmbErrorType err =
     vimba_camera_ptr_->StartContinuousImageAcquisition(1,  // num_frames_,
     IFrameObserverPtr(vimba_frame_observer_ptr_));

I have taken a look at the include/VimbaCPP/Source/Camera.cpp, specifically the StartContinuousImageAcquisition. But it seems that I would not be able to edit it because it is part of the compiled library provided by AVT. Any ideas guys?

I tried to print out the ROS_INFO_STREAM(IFrameObserverPtr(vimba_frame_observer_ptr_) during the initial start-up and the driver crashed. The crash happened when the IFrameObserverPtr(vimba_frame_observer_ptr_ was called the second time in the VmbErrorType err = line.

miquelmassot commented 6 years ago

Can you please tell which parameters were you trying to change? Does it happen with any parameter or only with a particular type?

samuel-ongzx commented 6 years ago

Thanks for the reply Miquel. I verified that it happens for all the parameters that I am trying to change. Not very sure why though.

shaun-edwards commented 6 years ago

I have seen this as well in ROS Indigo (using the Kinetic branch).

samuel-ongzx commented 6 years ago

I added launch-prefix="gdb -ex run --argsinto the launch file to try and get the error. gdb reports this upon changing any parameter on dynamic reconfigure: Program received signal SIGSEGV, Segmentation fault. 0x00000000004dbfef in AVT::VmbAPI::shared_ptr<AVT::VmbAPI::IFrameObserver>::shared_ptr<FrameObserver>(FrameObserver*) ()

miquelmassot commented 6 years ago

Hi @Rumpel-StiltSkin, can you please try branch [feature/frame_obs_ptr]?

samuel-ongzx commented 6 years ago

Hi Miquel, i tried the indigo branch with ROS Indigo and there was no problems with dynamic reconfigure. Let me try out the new branch that you have just committed. I will also be trying out ROS Kinetic with the Kinetic branch just to make sure that everything is working. I will report back the findings once I have them. Thanks again Miquel! Appreciate your help.

samuel-ongzx commented 6 years ago

It seems that the Kinetic Branch does not work with ROS Kinetic, and the driver crash upon changing any parameters using dynamic reconfigure. However, the branch [feature/frame_obs_ptr] solves the problem, and there was no camera crash due to the pointer upon changing any parameters. Thanks so much!

But, I did notice that the binning is not working correctly. I am able to change the binning (using dynamic reconfigure), but I am unable to un-bin the image after I have bin it. The only way to reset it would be to restart the camera driver. Also, the acquisition rate for my Mako-G 131C camera was stuck at around 10Hz and I was unable to push it up higher. I will take a look into both issues and report my findings back here.

miquelmassot commented 6 years ago

I'll close this issue since the problem is solved.

For the binning, we'll open another issue, and for the acquisition rate, please make sure that your exposure time is less than the period (1/frequency) you want to achieve.