## page was renamed from camera1394/Cturtle/Troubleshooting
## page was renamed from camera1394/Troubleshooting
##This is theTroubleshooting page for some component
##This page should probably be called ComponentName/Troubleshooting
##Please add errors and solutions as show below.

<<TableOfContents(3)>>

== Camera1394 Problems ==

=== Camera Not Found ===
'''Error:'''
 {{{
 $ rosrun camera1394 camera1394_node _guid:=08001000821f2a
 [ INFO] [1277163420.502573259]: Found camera with GUID 8144361026320a0
 [ INFO] [1277163420.536846060]: Found camera with GUID 800461000821fa2
 [FATAL] [1277163420.537210073]: [camera] exception opening device: [Camera1394::open]: Could not find camera with guid 0800461000821f2a
 }}}
'''Check: ''' 

 Is that the correct GUID? Note that in the example above it is not, the last two digits of 800461000821fa2 were mistyped.

'''Solution: ''' 
 Use the correct GUID. Or, if there is only one camera, omit the GUID so the driver will connect to the first available.

'''Check: ''' 

 Is the non-responsive camera plugged in correctly with an [[http://en.wikipedia.org/wiki/IEEE_1394_interface#Standards_and_versions|IEEE 1394 cable of the correct type]]? Is the camera getting power, either from the 1394 cable or from some other source?

'''Solution: ''' 
 If not, correct the cabling.

'''Check: ''' 
 Can `coriander` [[camera1394/Tutorials/ConnectingToIEEE1394Camera#Checking_Connectivity_with_Coriander|connect to the camera]]? 

'''Solution: ''' 
 If so, carefully note the parameters provided by the device. Start the `camera1394` driver using the same parameter values. If not, the camera may be [[#Camera_Hung|hung]].

<<Anchor(NoBusAccess)>>
=== No Bus Access Permissions ===
'''Error:'''
 {{{
 Could not initialize dc1394_context.
 }}}
'''Check: ''' 
 Does `/dev/video0` exist? 
 {{{
 $ ls -l /dev/video*
 crw-rw----+ 1 root video 81, 0 Feb  1 20:20 /dev/video0
 }}}
 Does your user ID have access permission?
 {{{
 $ id
 uid=1001(joq) gid=1001(joq) groups=44(video),115(admin),1001(joq)
 }}}

'''Solution: ''' 
 Grant your user ID access to group `video`.

=== No Images Shown ===
'''Error:'''
 Image blank or not changing.

'''Check: ''' 
 {{{
 $ rostopic hz camera/image_raw
 subscribed to [/camera/image_raw]
 average rate: 15.344
	min: 0.049s max: 0.082s std dev: 0.01015s window: 14
 average rate: 15.176
	min: 0.049s max: 0.082s std dev: 0.00699s window: 29
 average rate: 15.088
	min: 0.049s max: 0.082s std dev: 0.00585s window: 44
 average rate: 15.076

 }}}
 Does the message rate summary (shown above) appear periodically?

'''Solution: ''' 
 If so, the driver is publishing data. Check that image users connect to the correct topic names.

'''Check: '''
 Start the `reconfigure_gui` for this camera:
 {{{
 $ rosrun dynamic_reconfigure reconfigure_gui
 }}}

 * Are the `video_mode`, `frame_rate`, and `iso_speed` parameters set as expected?

'''Solution: '''
 If not, set the correct parameter values in the GUI.

'''Check: '''
 * Can `coriander` [[camera1394/Tutorials/ConnectingToIEEE1394Camera#Checking_Connectivity_with_Coriander|display images from this camera]] using the ''same'' combination of parameters? 
 * Can `coriander` display images from this camera using the ''some'' combination of parameters? 

'''Solution: '''
 If so, change the parameters to a combination that works. Otherwise, the camera is probably [[#Camera_Hung|hung]].

<<Anchor(CameraHung)>>
=== Camera Hung ===

'''Error: '''
 Many IIDC cameras are very sensitive to invalid combinations of parameters. The device firmware may lock up if commanded to do something impossible.

'''Check: '''
 * Does the camera respond after resetting the 1394 bus?
   {{{
   # install package for Ubuntu or Debian distributions:
   $ sudo apt-get install libdc1394-utils 
   $ dc1394_reset_bus
   }}}
 * Does the camera respond after its cable is disconnected and reconnected?
 * Does the camera respond after the kernel drivers are unloaded and reloaded?
 * Does the camera respond after the computer is rebooted?

'''Solution: '''
 If so, restart the driver.

=== Slow Frame Rate ===

'''Error: '''
 Camera is not achieving the commanded `frame_rate`

'''Check: '''
 {{{
 $ rostopic hz camera/image_raw
 subscribed to [/camera/image_raw]
 average rate: 15.027
	min: 0.054s max: 0.081s std dev: 0.00732s window: 15
 average rate: 15.004
	min: 0.026s max: 0.101s std dev: 0.01129s window: 30
 average rate: 15.004
	min: 0.026s max: 0.101s std dev: 0.01130s window: 45
 average rate: 14.968
	min: 0.026s max: 0.101s std dev: 0.01260s window: 60
 }}}
 Is the driver publishing raw images at the expected rate?

'''Solution: '''
 If not, start the `reconfigure_gui` for this camera:
 {{{
 $ rosrun dynamic_reconfigure reconfigure_gui
 }}}

 Some feature settings may be prevent the camera from meeting its desired `frame_rate`. For example, if the `shutter` time is longer than the time between frames, the camera will either fall behind or force the `shutter` time to a shorter exposure. In poor lighting conditions, it may be necessary to adjust several parameters to get an acceptable compromise between picture brightness and frame rate.

== Useful Links ==

 * http://damien.douxchamps.net/ieee1394/libdc1394/v2.x/faq/
 * https://ieee1394.wiki.kernel.org/index.php/FAQ
 * http://www.tldp.org/HOWTO/libdc1394-HOWTO/concepts.html#common_problems
 * http://www.tldp.org/HOWTO/libdc1394-HOWTO/index.html