Go to the documentation of this file.00001 import roslib
00002 roslib.load_manifest('hrl_camera')
00003 import cv
00004 import camera_setup_lib as csl
00005 import camera
00006
00007 class dragonfly2(camera.camera):
00008 def __init__(self, camera_configuration, opencv_id):
00009 self.config = camera_configuration
00010 self.device = opencv_id
00011 self._set_registers()
00012 camera.camera.__init__(self, camera_configuration, opencv_id)
00013
00014
00015
00016
00017
00018 cur_codec = cv.GetCaptureProperty(self.capture, cv.CV_CAP_PROP_MODE)
00019 print "dragonfly2: current codec interpretation is : ", cur_codec
00020 integ = cv.SetCaptureProperty(self.capture,cv.CV_CAP_PROP_MODE,
00021 self.config['cv_cap_prop_mode'])
00022
00023
00024
00025
00026 fps = cv.GetCaptureProperty(self.capture, cv.CV_CAP_PROP_FPS)
00027 print "dragonfly2: fps : ", fps
00028 next_codec = cv.GetCaptureProperty(self.capture, cv.CV_CAP_PROP_MODE)
00029 print "dragonfly2: current codec interpretation is : ", next_codec
00030
00031 def _set_registers(self):
00032 csl.init_bus1394()
00033
00034 csl.setRegister(self.device,0x604,0xA0000000)
00035
00036 csl.setRegister(self.device,0x608,0x20000000)
00037
00038 csl.setRegister(self.device, 0x1048, 0x80000081)
00039
00040 mode = csl.getRegister(self.device, 0x604)
00041 format= csl.getRegister(self.device, 0x608)
00042 rate = csl.getRegister(self.device, 0x600)
00043
00044 print "dragonfly2: mode", hex(mode)
00045 print "dragonfly2: format", hex(format)
00046 print "dragonfly2: rate", hex(rate)
00047
00048