🔶General Condition Judgment

Function Description

The General Condition Judgment operator is used to compare a property value of input data with a set threshold, supporting various data types (such as numbers, strings, lists, images, point clouds, pose lists, etc.), and allows users to specify the property to be compared (such as list length, numerical value, or specific property values of lists/dictionaries). Comparison conditions include greater than, greater than or equal to, equal to, less than, and less than or equal to, finally outputting a judgment result.

Usage Scenarios

  • Process control: Based on the size, quantity, or specific property values of previous calculation results, determine different branches for algorithm workflow direction. For example, if the number of detected targets is greater than 0, execute grasping; otherwise, retake photos.

  • Status checking: Determine whether an input value equals the expected value.

  • Loop control: Serve as judgment conditions in loop structures.

Input and Output

Input

Data to be judged: Data type that needs to be instantiated as input.

Output

True output: When the judgment condition is met, this port outputs True, otherwise outputs False.

False output: When the judgment condition is not met, this port outputs True, otherwise outputs False.

Parameter Description

Judgment Condition

Parameter Description

Select the logical operator used to compare data property values with the judgment threshold.

Parameter Adjustment

Choose 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 to compare with the selected property value of input data.

Parameter Adjustment

Input a value for comparison. For example, if judging whether list length is greater than 5, set this value to "5"; if judging whether score equals 0.8, set to "0.8". Ensure the input value can be correctly interpreted as the target comparison type.

Parameter Range

Default value: 0

Comparison Property

Parameter Description

Depending on the input data type, different parameter names are displayed, used to select which property of the input data should be compared with the "judgment threshold".

Parameter Adjustment

Available properties depend on the data type.

  • For list, dictionary, string types, you can usually choose len (length/number of elements) or value (attempt to compare the entire object, may only be suitable for simple types).

  • For numerical types (such as Float, Integer), usually only value (the numerical value itself) is available.

Parameter Range

Usually defaults to "value" or "len".

Compare Internal Element Properties

Parameter Description

Only appears and takes effect when the input data is a list type (such as pose lists, pick point lists, etc.) and its internal elements (usually dictionaries or objects) have comparable properties. It determines whether to compare properties of the list itself (such as length) or compare a specific property of the first element in the list.

Parameter Adjustment

  • Enabled (default): Do not compare the list itself, but extract the first element from the list and compare a specific internal property of that element.

  • Disabled: Compare properties of the list itself.

Internal Element Property Name

Parameter Description

Only takes effect when "Compare Internal Element Properties" switch is turned on. Based on the list element type, select the name of the internal property to be compared.

Parameter Adjustment

The dropdown list will display comparable properties contained in the list elements. Select the internal element property you wish to use for judgment.

Empty Array Sub-property Judgment Output

Parameter Description

Only takes effect when input data is a list type, the list is empty, and "Compare Internal Element Properties" is enabled. Used to define what the operator’s output should be (True or False) in this special case.

Parameter Adjustment

Since no first element can be extracted from an empty list to compare its sub-properties, you need to explicitly specify the expected result in this case.

  • Disabled (default): If empty list needs to judge sub-properties, the final condition judgment result outputs False.

  • Enabled: If empty list needs to judge sub-properties, the final condition judgment result outputs True.