GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoWebScanVisionCombiner.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanVisionCombiner.h
3 * @brief Declares a GoWebScanVisionCombiner object.
4 *
5 * @internal
6 * Copyright (C) 2017-2018 by LMI Technologies Inc.
7 * Licensed under the MIT License.
8 * Redistributed files must retain the above copyright notice.
9 */
10 
11 #ifndef GO_WEB_SCAN_VISION_COMBINER_H
12 #define GO_WEB_SCAN_VISION_COMBINER_H
13 
19 #include <kApi/Data/kArrayList.h>
20 
21 
22 kBeginHeader()
23 
24 /**
25  * @class GoWebScanVisionCombiner
26  * @extends kObject
27  * @ingroup GoWebScanSdk-Algorithms
28  * @brief Represents an algorithm to retain vision and terrain messages until a matching set in Y is
29  * available. The combiner emits a frame when it has one vision image and all of the profiles
30  * that potentially overlap in Y with that vision image.
31  *
32  * Algorithm steps:
33  * -# Vision and terrian tiles are enqueued as they arrive.
34  * -# The min and max Y-extents of the demosaiced image are determined (after applying
35  * Y-offsets from system calibration).
36  * -# Based on the Y-extents, any vision tiles completely overlapping with other vision
37  * tiles are discarded.
38  * -# Based on the Y position min and max limits per vision tile, profile tiles are matched.
39  */
41 
42 /**
43 * @struct GoWebScanVisionCombinerParams
44 * @extends kValue
45 * @ingroup GoWebScanSdk-Algorithms
46 * @brief Represents parameters of the vision combiner algorithm.
47 */
49 {
50  k64s minimumTileYExtent; ///< Expected minimum Y extent of each vision tile
51  k64s coherencyDistance; ///< Lane is disabled if the distance between the first undelivered tile and last undelivered tile exceed this threshold (mils).
52  k64s coherencyTime; ///< Lane is disabled if the time between the first undelivered tile and the last undelivered tile exceed this threshold (microseconds).
54 
55 /** Defines the signature for the handler for accepting the output matched vision and profile tiles. */
56 typedef kStatus(kCall *GoWebScanVisionCombinerDataFx)(kPointer context, GoWebScanVisionInputMsg visionInput, k64s profileTileStart,
57  GoWebScanProfileTileMsg* profileTiles, kSSize profileTileCount);
58 
59 /** Defines the signature for the handler to compute the min and max Y-extents for a vision tile. */
60 typedef kStatus(kCall *GoWebScanVisionCombinerPositionFx)(kPointer context, GoWebScanVisionInputMsg visionInput, k64s* firstTile, k64s* lastTile);
61 
62 /**
63  * Constructs a GoWebScanVisionCombiner object.
64  *
65  * @public @memberof GoWebScanVisionCombiner
66  * @param combiner Receives the constructed GoWebScanVisionCombiner object.
67  * @param args Algorithm parameters.
68  * @param allocator Memory allocator (or kNULL for default).
69  * @return Operation status.
70  */
72 
73 /**
74 * Sets the handler for accepting the output data from the algorithm. Typically the
75 * matched vision and profile tiles would be passed to the vision resampler algorithm.
76 *
77 * @public @memberof GoWebScanVisionCombiner
78 * @param combiner GoWebScanVisionCombiner object.
79 * @param data Callback function
80 * @param context Receiver argument for callback.
81 * @return Operation status.
82 */
84 
85 /**
86  * Sets the handler for determining the min and max Y-extents of the vision tile.
87  *
88  * @public @memberof GoWebScanVisionCombiner
89  * @param combiner GoWebScanVisionCombiner object.
90  * @param data Callback function
91  * @param context Receiver argument for callback.
92  * @return Operation status.
93  */
95 
96 /**
97  * Adds a vision or profile tile message to the algorithm processing queue.
98  *
99  * @public @memberof GoWebScanVisionCombiner
100  * @param combiner GoWebScanVisionCombiner object.
101  * @param msg Tile message to add. Message type ID should be
102  * GO_WEB_SCAN_MSG_TYPE_VISION_INPUT or GO_WEB_SCAN_MSG_TYPE_PROFILE_TILE.
103  * @return Operation status.
104  */
106 
107 /**
108 * Clears and relinquishes all lane tile queues.
109 *
110 * @public @memberof GoWebScanVisionCombiner
111 * @param combiner GoWebScanVisionCombiner object.
112 * @return Operation status.
113 */
115 
116 
117 kEndHeader()
118 #include <GoWebScanSdk/GoWebScanVisionCombiner.x.h>
119 
120 #endif
kStatus GoWebScanVisionCombiner_SetDataHandler(GoWebScanVisionCombiner combiner, GoWebScanVisionCombinerDataFx data, kPointer context)
Sets the handler for accepting the output data from the algorithm.
kStatus GoWebScanVisionCombiner_Add(GoWebScanVisionCombiner combiner, GoWebScanPipeMsg msg)
Adds a vision or profile tile message to the algorithm processing queue.
kStatus GoWebScanVisionCombiner_SetPositionHandler(GoWebScanVisionCombiner combiner, GoWebScanVisionCombinerPositionFx data, kPointer context)
Sets the handler for determining the min and max Y-extents of the vision tile.
Represents parameters of the vision combiner algorithm.
Definition: GoWebScanVisionCombiner.h:48
kStatus(kCall * GoWebScanVisionCombinerDataFx)(kPointer context, GoWebScanVisionInputMsg visionInput, k64s profileTileStart, GoWebScanProfileTileMsg *profileTiles, kSSize profileTileCount)
Defines the signature for the handler for accepting the output matched vision and profile tiles...
Definition: GoWebScanVisionCombiner.h:56
k64s coherencyDistance
Lane is disabled if the distance between the first undelivered tile and last undelivered tile exceed ...
Definition: GoWebScanVisionCombiner.h:51
k64s coherencyTime
Lane is disabled if the time between the first undelivered tile and the last undelivered tile exceed ...
Definition: GoWebScanVisionCombiner.h:52
Declares the GoWebScanPipeMsg class.
kStatus(kCall * GoWebScanVisionCombinerPositionFx)(kPointer context, GoWebScanVisionInputMsg visionInput, k64s *firstTile, k64s *lastTile)
Defines the signature for the handler to compute the min and max Y-extents for a vision tile...
Definition: GoWebScanVisionCombiner.h:60
Essential GoWebScan declarations.
kStatus GoWebScanVisionCombiner_Construct(GoWebScanVisionCombiner *combiner, const GoWebScanVisionCombinerParams *args, kAlloc allocator)
Constructs a GoWebScanVisionCombiner object.
Represents a message containing a raw vision message from a sensor.
Represents a message containing a tile of X and Y resampled profile Z data. This message can be used ...
kStatus GoWebScanVisionCombiner_Clear(GoWebScanVisionCombiner combiner)
Clears and relinquishes all lane tile queues.
k64s minimumTileYExtent
Expected minimum Y extent of each vision tile.
Definition: GoWebScanVisionCombiner.h:50
Defines GoWebScan utility functions.
Declares a GoWebScanProfileTileMsg object.
Represents an algorithm to retain vision and terrain messages until a matching set in Y is available...
Base class for a msg that can be processed with a GoWebScanPipeTask and submitted to the GoWebScanPip...
Declares a GoWebScanVisionInputMsg object.