FB_RandomTargetsGenerator - SetTargetsInPlaneRotationList (Method)
Type: |
Method |
Available as of: |
V1.1.0.0 |
This chapter provides information on:
oTask
Define a set of constraints for the generation of random targets.
The method SetTargetsInPlaneRotationList allows you to define a set of constraints for the generation of random targets contained in a selected working plane.
The rotation of the targets is randomly selected from a list of possible rotations.
To define a specific value for a constraint, set the minimum and the maximum to the same value.
The following is an example of target generation in a selected plane:
1 Collision circle to determine overlaps
Input |
Data type |
Description |
---|---|---|
i_udiNumberOfTargets |
UDINT |
Number of targets to be generated by the method. |
i_lrTargetOverlapRadius |
LREAL |
Radius of a circle around each target. The targets are generated so that there are no overlaps between the circles. This value must be either 0 or positive. If value = 0 the collision verification is ignored. |
i_udiMaxOverlapCheckIterations |
UDINT |
The method attempts i_udiMaxOverlapCheckIterations times to generate i_udiNumberOfTargets targets without overlaps. After this number of iterations is exceeded, an error message is generated. |
i_etPlane |
Used to select a working plane (for example, XY, XZ, YZ). The value of this input cannot be ROB.ET_WorkingPlane.None. While a specific working plane is selected, any generated pose describes a position contained in the plane (the position along the third 3D axis is set to 0) and a rotation about a vector normal to the plane. |
|
i_stMinPosition |
Minimum position value that a generated target can take. It can be considered as the minimum Cartesian coordinate contained in a volume defined by you. |
|
i_stMaxPosition |
Maximum position value that a generated target can take. It can be considered as the maximum Cartesian coordinate contained in a volume defined by you. |
|
i_alrRotationList |
ARRAY [1... Gc_uiMaxNumberOfRotations] OF LREAL |
List of rotations. On each call of the method Generate(), a rotation value is selected in accordance to the values listed in i_alrRotationProbabilityList. |
i_alrRotationProbabilityList |
ARRAY [1... Gc_uiMaxNumberOfRotations] OF LREAL |
List used to define the probabilities related to the random selection of a rotation from i_alrRotationList. The probability of each rotation is evaluated as the ratio between the value assigned to each element of the array and the total sum of all the listed values. |
i_etOrientationConvention |
Convention for the rotation angles of the orientation. |
|
i_alrTargetTypeProbabilityList |
ARRAY [1...Gc_uiMaxNumberOfTargetTypes] OF LREAL |
Every index of this array is linked to a specific target type and every element contains a value that affects the probability that a target with a certain target type is randomly generated. The probability of each target type is evaluated as the ratio between the value assigned to each element of the array and the total sum of the listed values. Example: A value in the field [1] of the array is linked to the generation of targets of type 1, field [2] is linked to type 2, and so on. |
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
|
q_sMsg |
STRING[80] |
Event-triggered message that gives more detailed information on the diagnostic state. |
q_etDiag |
q_etDiagExt |
Enumeration value of q_etDiagExt |
Description |
---|---|---|---|
Ok |
0 |
Ok |
|
InputParameterInvalid |
54 |
Number of targets out of range. |
|
InputParameterInvalid |
55 |
Maximum number of iterations out of range. |
|
InputParameterInvalid |
38 |
Invalid orientation convention. |
|
InputParameterInvalid |
37 |
The selected working plane is invalid. |
|
InputParameterInvalid |
40 |
The X position range provided as constraint of the random generation is invalid. |
|
InputParameterInvalid |
41 |
The Y position range provided as constraint of the random generation is invalid. |
|
InputParameterInvalid |
42 |
The Z position range provided as constraint of the random generation is invalid. |
|
InputParameterInvalid |
47 |
The sum of the rotation probabilities provided by you is zero. |
|
InputParameterInvalid |
48 |
A negative value for one of the probabilities related to the list of possible rotations was provided. |
|
InputParameterInvalid |
53 |
A negative radius value was provided. |
|
InputParameterInvalid |
61 |
The sum of the probabilities is zero. |
|
InputParameterInvalid |
60 |
The value of one of the probabilities is negative. |
|
UnexpectedProgramBehavior |
39 |
The random seed value was initialized to an invalid value |
MaxOverlapCheckIterationsRange
Enumeration name: |
MaxOverlapCheckIterationsRange |
Enumeration value: |
55 |
Description: |
Maximum number of iterations out of range. |
Issue |
Cause |
Solution |
---|---|---|
Provided value out of range. |
The value of i_udiMaxOverlapCheckIterations cannot be less than i_udiNumberOfTargets. |
oProvide a value so that i_udiMaxOverlapCheckIterations ≥ i_udiNumberOfTargets oA first attempt value could be i_udiMaxOverlapCheckIterations ≥ 2 * i_udiNumberOfTargets. But this can vary, depending on the other constraints. |
Enumeration name: |
NumberOfTargetsRange |
Enumeration value: |
54 |
Description: |
Number of targets out of range. |
Issue |
Cause |
Solution |
---|---|---|
Provided value out of range. |
The value provided by you is either minor that 1 or greater than Gc_udiMaxNumberOfGeneratedTargets (for example, the maximum size of the list). |
Provide a value within the valid range. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
The parameters were successfully set.
Enumeration name: |
OrientationConventionInvalid |
Enumeration value: |
38 |
Description: |
Invalid orientation convention. |
Issue |
Cause |
Solution |
---|---|---|
The orientation convention is invalid. |
The input value of i_etOrientationConvention is invalid. |
Provide one of the permissible values of ROB.ET_OrientationConvention. |
Enumeration name: |
PlaneInvalid |
Enumeration value: |
37 |
Description: |
The selected working plane is invalid. |
Issue |
Cause |
Solution |
---|---|---|
The selected working plane is invalid. |
The provided value does not identify a known working plane. |
Verify that the value is chosen from this set: oROB.ET_WorkingPlane.XY oROB.ET_WorkingPlane.XZ oROB.ET_WorkingPlane.YZ Refer to, Robotic Library - ET_WorkingPlane. |
Enumeration name: |
PositionXRange |
Enumeration value: |
40 |
Description: |
The X position range provided as constraint of the random generation is invalid. |
Issue |
Cause |
Solution |
---|---|---|
The X position range provided as constraint of the random generation is invalid. |
The provided X position range is invalid. |
oProvide a range that respects the following condition: i_stMinPosition.lrX ≤ i_stMaxPosition.lrX oIf a working plane was selected, verify that i_stMinPosition.lrX and i_stMaxPosition.lrX are contained in the plane. |
Enumeration name: |
PositionYRange |
Enumeration value: |
41 |
Description: |
The Y position range provided as constraint of the random generation is invalid. |
Issue |
Cause |
Solution |
---|---|---|
The Y position range provided as constraint of the random generation is invalid. |
The provided Y position range is invalid. |
oProvide a range that respects the following condition: i_stMinPosition.lrY ≤ i_stMaxPosition.lrY oIf a working plane was selected, verify that i_stMinPosition.lrY and i_stMaxPosition.lrY are contained the plane. |
Enumeration name: |
PositionZRange |
Enumeration value: |
42 |
Description: |
The Z position range provided as constraint of the random generation is invalid. |
Issue |
Cause |
Solution |
---|---|---|
The Z position range provided as constraint of the random generation is invalid. |
The provided Z position range is invalid. |
oProvide a range that respects the following condition: i_stMinPosition.lrZ ≤ i_stMaxPosition.lrZ oIf a working plane was selected, verify that i_stMinPosition.lrZ and i_stMaxPosition.lrZ are contained the plane. |
Enumeration name: |
RandomSeedInvalid |
Enumeration value: |
39 |
Description: |
The random seed value was initialized to an invalid value. |
Issue |
Cause |
Solution |
---|---|---|
The random seed value was internally set to an invalid value. |
- |
Contact your Schneider Electric representative. |
RotationProbabilitiesSumInvalid
Enumeration name: |
RotationProbabilitiesSumInvalid |
Enumeration value: |
47 |
Description: |
The sum of the rotation probabilities provided is zero. |
Issue |
Cause |
Solution |
---|---|---|
The sum of the provided rotation probabilities is 0. |
The sum of the probabilities listed inside the input i_alrRotationProbabilityList must be greater than 0. |
Verify that the sum of the provided probabilities is > 0. |
Enumeration name: |
RotationProbabilityRange |
Enumeration value: |
48 |
Description: |
A negative value for one of the probabilities related to the list of possible rotations was provided. |
Issue |
Cause |
Solution |
---|---|---|
A a negative value for one of the probabilities related to the list of possible rotations was provided. |
One of the probabilities inside i_alrRotationProbabilityList has a negative value. |
Verify that every probability has a value of zero or a positive value. |
Enumeration name: |
TargetOverlapRadiusRange |
Enumeration value: |
53 |
Description: |
A negative radius value was provided. |
Issue |
Cause |
Solution |
---|---|---|
A negative or zero value was provided as input. |
The value of the radius must be strictly positive. |
Verify that i_lrTargetOverlapRadius > 0. |
TargetTypeProbabilitiesSumInvalid
Enumeration name: |
TargetTypeProbabilitiesSumInvalid |
Enumeration value: |
61 |
Description: |
The sum of probabilities is zero. |
Issue |
Cause |
Solution |
---|---|---|
The sum of the provided probabilities is 0. |
The sum of the probabilities listed inside the input i_alrTargetTypeProbabilityList must be greater than 0. |
Verify that the sum of the provided probabilities is greater than 0. |
Enumeration name: |
TargetTypeProbabilityRange |
Enumeration value: |
60 |
Description: |
The value of one of the probabilities is negative. |
Issue |
Cause |
Solution |
---|---|---|
The value of one of the probabilities is negative. |
One of the probabilities inside i_alrTargetTypeProbabilityList has a negative value. |
Verify that every probability has either a value of 0 or a positive value. |