-
Notifications
You must be signed in to change notification settings - Fork 2
/
camera_base.orogen
232 lines (201 loc) · 11 KB
/
camera_base.orogen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name 'camera_base'
using_library "frame_helper"
using_library "camera_interface"
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').
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',640).
doc 'width of the camera frame'
property('height', 'int',480).
doc 'height of the camera frame'
property('fps', 'double',10).
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', '/std/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('target_gray_value', 'int',128).dynamic
doc 'target average gray value for the auto exposure and auto gain features'
property('exposure_power', 'bool',true).
doc 'turns exposure on or off'
property('exposure', 'int',5000).dynamic
doc 'exposure value if exposure mode is not auto'
property('exposure_mode', 'string','auto').dynamic
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('saturation_power', 'bool',true).
doc 'turns saturation on or off'
property('saturation', 'int',300).dynamic
doc 'saturation if saturation mode is not auto'
property('saturation_mode', 'string','auto').dynamic
doc 'saturation mode (auto, manual)'
property('sharpness_power', 'bool',true).
doc 'turns sharpness on or off'
property('sharpness', 'int',300).dynamic
doc 'sharpness if sharpness mode is not auto'
property('sharpness_mode', 'string','auto').dynamic
doc 'sharpness mode (auto, manual)'
property('shutter_time', 'int',300).dynamic
doc 'shutter time if shutter mode is not auto'
property('shutter_mode', 'string','auto').dynamic
doc 'shutter mode (auto, manual)'
property('whitebalance_power', 'bool',true).
doc 'turns whitebalance on or off'
property('whitebalance_mode', '/std/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', 'FrameTriggerReady').
doc 'sync out1 mode (GPO, AcquisitionTriggerReady, FrameTriggerReady, FrameTrigger, Exposing, FrameReadout, Acquiring, SyncIn1, SyncIn2, Strobe1)'
property('sync_out2_mode','string', 'FrameTriggerReady').
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 'Calibration parameters for the camera, which are used to undistort and are added as attributes to the frames'
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###########################
###########################################################
reports :NO_CAMERA,:CONFIGURE_ERROR, :CANNOT_START_GRABBING, :UNKOWN_PARAMETER, :UNSUPPORTED_PARAMETER,:PROCESSING_ERROR
reports :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
# Task to pre-process images before used by other components
task_context "Preprocess" do
reports :PROCESSING_ERROR
needs_configuration
input_port('iframe', ro_ptr('base::samples::frame::Frame'))
output_port 'oframe', ro_ptr('base::samples::frame::Frame')
property("undistort","bool",false).
doc 'true => undistort the image before it is written to the output port'
property("calibration_parameters","frame_helper/CameraCalibration").
doc 'Calibration parameters for the camera, which are used to undistort and are added as attributes to the frames'
property("format", "/base/samples/frame/frame_mode_t", :MODE_UNDEFINED).
doc "The image 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."
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"
port_driven
end