-
Notifications
You must be signed in to change notification settings - Fork 0
/
buoy.orogen
412 lines (308 loc) · 14.9 KB
/
buoy.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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
name "buoy"
# Optionally declare the version number
# version "0.1"
# If new data types need to be defined, they have to be put in a separate C++
# header, and this header will be loaded here
# import_types_from "buoy_detectorType.hpp"
# If the component/deployments use data types that are defined in other oroGen
# projects, these projects should be imported there as well.
using_library "opencv"
#using_library "eigen2"
using_library "frame_helper"
using_library "visual_detectors"
import_types_from "base"
import_types_from "visual_detectors/Types.hpp"
import_types_from "SonarDetectorTaskTypes.hpp"
import_types_from "auv_control"
task_context "Survey" do
# --------------------------------------------------------------------------
# BUOY_DETECTED: found a buoy within a sequence of frames
# BUOY_LOST: lost the buoy over a sequence of frames
# --------------------------------------------------------------------------
states("BUOY_SEARCH", "BUOY_DETECTED", "BUOY_LOST", "RE_SEARCHING_BUOY", "BUOY_ARRIVED", "STRAFING",
"STRAFE_FINISHED", "STRAFE_ERROR", "MOVING_TO_CUTTING_DISTANCE", "CUTTING",
"CUTTING_SUCCESS", "CUTTING_ERROR", "STRAFE_TO_ANGLE", "ANGLE_ARRIVED")
# --------------------------------------------------------------------------
# I n p u t s
# --------------------------------------------------------------------------
input_port("orientation_samples", "base::samples::RigidBodyState").
doc 'Vehicle orientation with depth'
input_port("force_cutting", "bool").
doc("if true the task will direktly go tu STRAFE_FINISHED-state")
input_port("input_buoy", "/avalon/feature/Buoy").
doc("feature data of a buoy with the highest probability in frame")
input_port("motion_command", "/base/AUVMotionCommand").
doc("motion command submitted by nurc for surveying a specific yaw/z to buoy")
input_port("light", "bool").
doc("input-port, must be connected to detector.light")
input_port("target_angle_input", "double").
doc("if u submit a value to the task, it will automatically try to reach this heading while surrounding the buoy")
# --------------------------------------------------------------------------
# O u t p u t s
# --------------------------------------------------------------------------
output_port("strafed_angle", "double").
doc("the angle that was strafed in pi...")
output_port("relative_position", "/base/AUVPositionCommand").
doc("relative position of the buoy in frame")
output_port("position", "/base/samples/RigidBodyState").
doc("outputs current yaw and z-depth during buoy survey")
# --------------------------------------------------------------------------
# P r o p e r t i e s
# --------------------------------------------------------------------------
property("max_buoy_distance", "double", 2.0).
doc("maximum buoy distance in m")
property("strafe_intensity", "double", -0.8).
doc("intensity and direction of strafing (negative is right).")
property("steps", "int", 5).
doc("Step size to detect V value.")
property("lost_timeout", "int", 20).
doc("timeout how long it takes to change state from RE_SEARCHING_BUOY to BUOY_LOST.")
property("good_y_z", "double", 0.2).
doc("for detecting if the buoy is in a good position to strafe.")
property("good_x", "double", 0.3).
doc("for detecting if the buoy is in a good position to strafe.")
property("buoy_depth", "double", -1.0).
doc("the absolute high of the buoy in the water.")
property("headingFactor", "double", 1.0).
doc("factor multiplied for heading")
property("headingModulation", "double", 0.0).
doc("pre-heading for strafing")
property("maxX", "double", 0.2).
doc("maximum x value for strafing")
property("cutting_time", "int", 53).
doc("time for the cutting-action in seconds.")
property("cutting_hight", "double", -0.25).
doc("how much higher should he go to cut the buoy.")
property("strafe_angle", "double", 0.95).
doc("the angle that is to strafe around the buoy and bagwards. it has to be 0<x<1, where the angle is x*pi where 1*pi=180deg.")
property("strafe_around", "bool", 0).
doc("if it is true the strafe_angle will be ignored and the auv will strafe in a hole cycle around the buoy.")
property("cutting_wait_time", "int", 60).
doc("time in seconds to wait in moving_to_cutting_distance before cutting.")
property("z_offset", "double", 0).
doc("the offset is permanently added to the z-command")
port_driven 'input_buoy'
end
task_context "Detector" do
# --------------------------------------------------------------------------
# BUOY_DETECTED: found a buoy within a sequence of frames
# BUOY_LOST: lost the buoy over a sequence of frames
# --------------------------------------------------------------------------
states("BUOY_FOUND", "NO_BUOY_FOUND")
# --------------------------------------------------------------------------
# I n p u t s
# --------------------------------------------------------------------------
input_port("frame", ro_ptr("base::samples::frame::Frame")).
doc("current frame given from a camera on which a buoy should be detected")
# --------------------------------------------------------------------------
# O u t p u t s
# --------------------------------------------------------------------------
output_port("buoy", "/avalon/feature/Buoy").
doc("feature data of a buoy with the highest probability in frame")
output_port("light", "bool").
doc("sent true if a light has been detected onto a buoy")
output_port("h_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("s_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("v_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("binary_debug_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("gray_debug_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("hough_debug_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("other_buoys","std::vector</avalon/feature/Buoy>").
doc("only for debugging")
output_port("debug_image", ro_ptr("base::samples::frame::Frame")).
doc("the image which is shown in the light_image field in the debug-gui")
# --------------------------------------------------------------------------
# P r o p e r t i e s
# --------------------------------------------------------------------------
property("buoy_radius", "double", 0.05). #bei boye mit d=25cm ist wert von 0.05 realistisch. wieso?
doc("radius of the buoy in m")
#Properties for the Hough
property("hHoughAccumulatorThreshold", "int", 25).
doc("Hough threshold.")
property("sHoughAccumulatorThreshold", "int", 25).
doc("Hough threshold.")
property("vHoughAccumulatorThreshold", "int", 25).
doc("Hough threshold.")
property("hHoughEdgeThreshold", "int", 25).
doc("Hough threshold.")
property("sHoughEdgeThreshold", "int", 25).
doc("Hough threshold.")
property("vHoughEdgeThreshold", "int", 25).
doc("Hough threshold.")
property("houghMinCircle", "int", 40).
doc("Buoy hue value.")
property("houghMaxCircle", "int", 55).
doc("Buoy saturation value.")
#Property for the HSV
property("hValueMin", "int", 65).
doc("Buoy hue value.")
property("sValueMin", "int", 55).
doc("Buoy saturation value.")
property("vValueMin", "int", 40).
doc("Buoy hue value.")
property("hValueMax", "int", 65).
doc("Buoy hue value.")
property("vValueMax", "int", 40).
doc("Buoy hue value.")
property("sValueMax", "int", 55).
doc("Buoy saturation value.")
property("hSmooth", "int", 1)
property("sSmooth", "int", 1)
property("vSmooth", "int", 1)
property("debug_gui", "bool", true).
doc("Sets test mode.")
property("buoy_timeout", "int", 20).
doc("number of frames a buoy is not detected in order to set BUOY_LOST")
property("filter_timeout", "double", 1.5).
doc("the time in s how long a buoy of the past is noticed by the filter.")
property("roi_x", "double", 0).
doc("for light detection: relative region of interrest koordinate as factor of buoy-radius")
property("roi_y", "double", 0.2).
doc("for light detection: relative region of interrest koordinate as factor of buoy-radius")
property("roi_width", "double", 3.0).
doc("for light detection: retion of interrest width")
property("roi_height", "double", 3.0).
doc("for light detection: retion of interrest height")
property("buoy_color", "/avalon/feature/BuoyColor")
property("debug", "bool", 1).
doc("debugging or not?")
property("hsv_gray", "int", 0)
property("hough_debug_h", "bool", 0)
property("hough_debug_s", "bool", 0)
property("hough_debug_v", "bool", 0)
property("use_h", "bool", true)
property("use_s", "bool", true)
property("use_v", "bool", true)
property("buoys_buffer_size", "int", 5)
property("buoys_buffer_size_min", "int", 3)
property("startvalidation", "int", 100)
property("mindist", "int", 100)
port_driven("frame")
end
task_context "Detector2" do
# --------------------------------------------------------------------------
# BUOY_DETECTED: found a buoy within a sequence of frames
# BUOY_LOST: lost the buoy over a sequence of frames
# --------------------------------------------------------------------------
states("BUOY_FOUND", "NO_BUOY_FOUND")
# --------------------------------------------------------------------------
# I n p u t s
# --------------------------------------------------------------------------
input_port("frame", ro_ptr("base::samples::frame::Frame")).
doc("current frame given from a camera on which a buoy should be detected")
# --------------------------------------------------------------------------
# O u t p u t s
# --------------------------------------------------------------------------
output_port("buoy", "/avalon/feature/Buoy").
doc("feature data of a buoy with the highest probability in frame")
output_port("light", "bool").
doc("sent true if a light has been detected onto a buoy")
output_port("h_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("s_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("v_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("binary_debug_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("gray_debug_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("hough_debug_image", ro_ptr("base::samples::frame::Frame")).
doc("only for debugging")
output_port("other_buoys","std::vector</avalon/feature/Buoy>").
doc("only for debugging")
output_port("debug_image", ro_ptr("base::samples::frame::Frame")).
doc("the image which is shown in the light_image field in the debug-gui")
# --------------------------------------------------------------------------
# P r o p e r t i e s
# --------------------------------------------------------------------------
property("buoy_radius", "double", 0.05). #bei boye mit d=25cm ist wert von 0.05 realistisch. wieso?
doc("radius of the buoy in m")
#Properties for the Hough
property("hHoughAccumulatorThreshold", "int", 25).
doc("Hough threshold.")
property("sHoughAccumulatorThreshold", "int", 25).
doc("Hough threshold.")
property("vHoughAccumulatorThreshold", "int", 25).
doc("Hough threshold.")
property("hHoughEdgeThreshold", "int", 25).
doc("Hough threshold.")
property("sHoughEdgeThreshold", "int", 25).
doc("Hough threshold.")
property("vHoughEdgeThreshold", "int", 25).
doc("Hough threshold.")
property("houghMinCircle", "int", 40).
doc("Buoy hue value.")
property("houghMaxCircle", "int", 55).
doc("Buoy saturation value.")
#Property for the HSV
property("hValueMin", "int", 65).
doc("Buoy hue value.")
property("sValueMin", "int", 55).
doc("Buoy saturation value.")
property("vValueMin", "int", 40).
doc("Buoy hue value.")
property("hValueMax", "int", 65).
doc("Buoy hue value.")
property("vValueMax", "int", 40).
doc("Buoy hue value.")
property("sValueMax", "int", 55).
doc("Buoy saturation value.")
property("hSmooth", "int", 1)
property("sSmooth", "int", 1)
property("vSmooth", "int", 1)
property("debug_gui", "bool", true).
doc("Sets test mode.")
property("buoy_timeout", "int", 20).
doc("number of frames a buoy is not detected in order to set BUOY_LOST")
property("filter_timeout", "double", 1.5).
doc("the time in s how long a buoy of the past is noticed by the filter.")
property("roi_x", "double", 0).
doc("for light detection: relative region of interrest koordinate as factor of buoy-radius")
property("roi_y", "double", 0.2).
doc("for light detection: relative region of interrest koordinate as factor of buoy-radius")
property("roi_width", "double", 3.0).
doc("for light detection: retion of interrest width")
property("roi_height", "double", 3.0).
doc("for light detection: retion of interrest height")
property("buoy_color", "/avalon/feature/BuoyColor")
property("debug", "bool", 1).
doc("debugging or not?")
property("hsv_gray", "int", 0)
property("hough_debug_h", "bool", 0)
property("hough_debug_s", "bool", 0)
property("hough_debug_v", "bool", 0)
property("use_h", "bool", true)
property("use_s", "bool", true)
property("use_v", "bool", true)
property("buoys_buffer_size", "int", 5)
property("buoys_buffer_size_min", "int", 3)
property("startvalidation", "int", 100)
property("mindist", "int", 100)
port_driven("frame")
end
task_context "ServoingOnWall" do
input_port("buoy_samples", "/avalon/feature/Buoy")
input_port("wall_samples", "sonar_detectors::Wall")
input_port 'orientation_samples', 'base::samples::RigidBodyState'
output_port("world_cmd", "base::LinearAngular6DCommand")
output_port("aligned_position_cmd", "base::LinearAngular6DCommand")
property("distance_to_buoy", "double", 1)
property("target_heading", "double", 1.57)
property("heading_step_size", "double", 0.1)
property("aligned_distance", "double", 0.5)
states("ALIGNED", "BUOY_SERVOING", "PASSIVE_BUOY_SEARCHING")
error_states("WAIT_FOR_BUOY_SAMPLE", "WAIT_FOR_WALL_SAMPLE", "WAIT_FOR_ORIENTATION_SAMPLE" )
port_driven("buoy_samples")
end
deployment "buoy_test" do
task "buoy_survey", "buoy::Survey"
task "buoy_detector", "buoy::Detector"
add_default_logger
end