name 'camera_base' using_library "frame_helper" using_library "opencv" import_types_from "base" import_types_from "frame_helper/Calibration.h" import_types_from "frame_helper/FrameHelperTypes.h" import_types_from "camera_interface/CamTypes.h" task_context "Task" do needs_configuration ########################################################### ########################ports############################## ########################################################### output_port 'frame', ro_ptr('base::samples::frame::Frame') output_port('frame_raw', ro_ptr('base::samples::frame::Frame')). doc "unprocessed camera frame, disabled by default" ########################################################### ###################camera properties####################### ########################################################### property('camera_id', 'string','105984'). doc 'unique camerea id' property('camera_format', 'base/samples/frame/frame_mode_t', :MODE_BAYER). doc 'output format of the camera --> not the output port! see below' property('width', 'int',1024). doc 'width of the camera frame' property('height', 'int',768). doc 'height of the camera frame' property('fps', 'int',20). doc 'frames per second' property('grab_mode', 'camera/GrabMode', :Continuously). doc 'grab mode (Stop, SingleFrame, MultiFrame, Continuously)' property('frame_buffer_size', 'int',10). doc 'size of the frame buffer' property('clear_buffer_if_frame_drop', 'bool',false). doc 'if the queue is empty because retrieve was called too rarely clear buffer' property('disable_frame_raw',"bool",true). doc('no data are written to frame_raw if set to true') property('log_interval_in_sec', 'int',5). doc 'interval for logging a statistic about valid and invalid frames per second (0= logging of) -> it is saved as frame attrib StatFrameRate' property('region_x', 'int',0). doc 'start of region readout, in pixels; left edge.' property('region_y', 'int',0). doc 'start of region readout, in pixels; top edge.' property('trigger_mode', 'string','fixed'). doc 'trigger mode of the camera, allowed values: freerun, fixed, sync_in1, none' property('channel_data_depth', 'int',8). doc 'bit depth per channel' property('exposure', 'int',5000). doc 'exposure value if exposure mode is not auto' property('exposure_mode', 'string','auto'). doc 'exposure mode (auto, manual, external, none)' property('gain_mode_auto', 'bool',true). doc 'gain mode' property('gain', 'int',0). doc 'gain value' property('gamma', 'bool',true). doc 'turns gamma on or off' property('acquisition_frame_count', 'int', 200). doc 'count of frames if grab mode is MultiFrame' property('binning_x', 'int',1). doc 'horizontal binning. 1=no binning.' property('binning_y', 'int',1). doc 'vertical binning. 1=no binning.' property('mode', 'string','Master'). doc 'opening mode (Master, Monitor, MasterMulticast)' property('synchronize_time_interval', 'int',0). doc 'time interval in micro seconds which is used to synchronize camera time with system time. 0 == no synchronization' property('whitebalance_mode', 'string','auto'). doc 'whitebalance mode (auto, manual, auto_once, none)' property('whitebalance_blue', 'int',100). doc 'Blue gain expressed as a percentage of the camera default setting.' property('whitebalance_red', 'int',100). doc 'Red gain expressed as a percentage of the camera default setting.' property('whitebalance_auto_rate', 'int',100). doc 'How fast the Auto white balance will update.' property('whitebalance_auto_threshold', 'int',5). doc 'Sets a range of scene color changes in which the automatic whitebalance will not respond.' property('frame_start_trigger_event', 'string','none'). doc 'External trigger event, allowed values: EdgeRising, EdgeFalling, EdgeAny, LevelHigh, LevelLow, none' property('package_size', 'int',0). doc 'In Bytes. Size of image data packet. This size includes the GVSP, UDP, and IP headers. (0 == max possible)' property('sync_out1_mode','string', 'FrameTrigger'). doc 'sync out1 mode (GPO, AcquisitionTriggerReady, FrameTriggerReady, FrameTrigger, Exposing, FrameReadout, Acquiring, SyncIn1, SyncIn2, Strobe1)' property('sync_out2_mode','string', 'FrameTrigger'). doc 'sync out2 mode (GPO, AcquisitionTriggerReady, FrameTriggerReady, FrameTrigger, Exposing, FrameReadout, Acquiring, SyncIn1, SyncIn2, Strobe1)' ######################################################### #################output properties####################### ######################################################### property("undistort","bool",false). doc 'true => undistort the image before it is writen to the output port' property("calibration_parameters","frame_helper/CameraCalibration"). doc 'parameter for undistort' property("output_format", "/base/samples/frame/frame_mode_t", :MODE_UNDEFINED). doc "The camera_format is converted into this format before it is written to the output port " "Set it to MODE_UNDEFINED if you want to disable the conversion and the camera_format shall be used" property("resize_algorithm","/frame_helper/ResizeAlgorithm",:INTER_LINEAR). doc "resize algorithm which is used to scale the frame before it is written to the output port. " "allowed values are INTER_LINEAR, INTER_NEAREST, INTER_AREA, INTER_CUBIC, INTER_LANCZOS4, BAYER_RESIZE" property("scale_x", "double", 1). doc "scale factor for the x direction which is used to scale the image before it is written to the output_port. " property("scale_y", "double" ,1). doc "scale factor for the y direction which is used to scale the image before it is written to the output_port. " property("offset_x", "int", 0). doc "the offset to be used on the left margin in case of scaling" property("offset_y", "int", 0). doc "the offset to be used on the left margin in case of scaling" ########################################################### ##########################states########################### ########################################################### error_states :NO_CAMERA,:CONFIGURE_ERROR, :CANNOT_START_GRABBING, :UNKOWN_PARAMETER, :UNSUPPORTED_PARAMETER,:PROCESSING_ERROR fatal_states :NO_CAMERA_INTERFACE ########################################################### ###########methods to configure the camera################# ########################################################### operation('setDoubleAttrib'). returns('bool'). argument('type', '/camera/double_attrib/CamAttrib', 'type'). argument('value', 'double', 'value') operation('setEnumAttrib'). returns('bool'). argument('type', '/camera/enum_attrib/CamAttrib', 'type') operation('setIntAttrib'). returns('bool'). argument('type', '/camera/int_attrib/CamAttrib', 'type'). argument('value', 'int', 'value') operation('setStringAttrib'). returns('bool'). argument('type', '/camera/str_attrib/CamAttrib', 'type'). argument('value', 'string', 'value') operation('getDoubleAttrib'). returns('double'). argument('type', '/camera/double_attrib/CamAttrib', 'type') operation('isEnumAttribSet'). returns('bool'). argument('type', '/camera/enum_attrib/CamAttrib', 'type') operation('getIntAttrib'). returns('int'). argument('type', '/camera/int_attrib/CamAttrib', 'type') operation('getStringAttrib'). returns('string'). argument('type', '/camera/str_attrib/CamAttrib', 'type') operation('getIntRangeMin'). returns('int'). argument('type', '/camera/int_attrib/CamAttrib', 'type') operation('getIntRangeMax'). returns('int'). argument('type', '/camera/int_attrib/CamAttrib', 'type') operation('getDoubleRangeMin'). returns('double'). argument('type', '/camera/double_attrib/CamAttrib', 'type') operation('getDoubleRangeMax'). returns('double'). argument('type', '/camera/double_attrib/CamAttrib', 'type') end