Generic Condition Judge
Functional Description
The Generic Condition Judge operator is used to compare a certain attribute value of the input data with a set threshold. It supports various data types (such as numbers, strings, lists, images, point clouds, pose lists, etc.) and allows the user to specify the attribute to be compared (e.g., list length, numerical value, or specific attribute values of lists/dictionaries). Comparison conditions include greater than, greater than or equal to, equal to, less than, and less than or equal to. It ultimately outputs a judgment result.
Usage Scenarios
-
Flow Control: Determine the algorithm flow to different branches based on the size, quantity, or specific attribute value of the previous step’s calculation result. For example, if the number of detected targets is greater than 0, perform grasping; otherwise, retake a picture.
-
Status Check: Determine if an input value is equal to the expected value.
-
Loop Control: Serve as a judgment condition in a loop structure.
Inputs and Outputs
Input Item |
Data to be determined: The data type of the input needs to be instantiated. |
Output Item |
True output: When the judgment condition is met, this port outputs True; otherwise, it outputs False. False Output: When the judgment condition is not met, this port outputs True; otherwise, it outputs False. |
Parameter Description
Judge condition
Parameter Description |
Select the logical operator used to compare the data attribute value and the judgment threshold. |
Tuning Description |
Select the comparison relationship as needed. |
Parameter Range |
Greater than, Greater than or equal to, Equal to, Less than, Less than or equal to |
Judgment threshold
Parameter Description |
The threshold used for comparison with the selected attribute value of the input data. |
Tuning Description |
Enter a value for comparison. For example, if you want to judge whether the list length is greater than 5, set this value to "5"; if you want to judge whether the score is equal to 0.8, set it to "0.8". Ensure that the input value can be correctly interpreted as the target comparison type. |
Parameter Range |
Default value: 0 |
Compare properties
Parameter Description |
Displays different parameter names depending on the input data type, used to select which attribute of the input data to compare with the "Judgment threshold". |
Tuning Description |
The optional attributes depend on the data type.
|
Parameter Range |
Usually defaults to "value" or "len". |
Whether to compare internal element properties
Parameter Description |
This parameter may appear and take effect only when the input data is a list type (such as pose list, pick point list, etc.) and its internal elements (usually dictionaries or objects) have comparable attributes. It determines whether to compare the properties of the list itself (like length) or a specific attribute of the first element in the list. |
Tuning Description |
|
Internal element property name
Parameter Description |
Takes effect only when the "Whether to compare internal element properties" switch is on. Select the name of the internal attribute to be compared based on the type of list element. |
Tuning Description |
The dropdown list will display the comparable attributes contained in the list element. Select the internal element attribute you want to use for judgment. |
Empty array sub-property judgment output
Parameter Description |
Takes effect only when the input data is a list type, the list is empty, and "Whether to compare internal element properties" is enabled. Used to define whether the operator’s output should be True or False in this special case. |
Tuning Description |
Since the first element cannot be taken out to compare its sub-attributes when the list is empty, you need to explicitly specify the expected result in this case.
|