Warning
You are reading an old version of this documentation. If you want up-to-date information, please have a look at 5.1 .get_part
Important
This section is only relevant when a multi-model recipe is used in production. Refer to get_part for standard, single part recipe.
Parameters
None
Returns
200 x=<x> y=<y> rz=<rz> m=<model>
, where<x>
,<y>
,<rz>
are coordinates and orientation of the part and<model>
is the number of the model predicted by EYE+ else refer to error codes.
Note
The coordinates have 5 decimal digits (e.g. x = 10.00000
) and the angle has 2 (e.g. rz = 1.00
).
Description
Request one or more parts. A specific model can optionally be requested.
In the context of multi-model, this command can be used to retrieve the position of one or more specific parts that
match the requested model (e.g. one part of model 1
and one part of model 2
) or any pickable part of any model
(e.g. model 1
, model 3
…etc). This behavior is controlled by the part_quantity
parameter and the multi-model specific model_quantity parameter.
By default, this parameter is set to return a single part of the first model found by the system.
If model_quantity is set to 0 for every model defined in the recipe, the system will return the first pickable part it finds regardless of the model.
Note
Notice that changing model_quantity for any model while a get_part is pending will not affect it. Only subsequent get_part will consider the newly set values.
Note
This command will block until the requested parts are found and can be returned. A 30-second timeout is set by default. The command returns an error if the requested number of parts of the requested model(s) cannot be found within the time period. The timeout can be adjusted before calling get_part (refer to set_parameter).
Assume 4 models were defined in the recipe.
Default working principle
Parameters set to:
model_quantity 1 0
model_quantity 2 0
model_quantity 3 0
model_quantity 4 0
The command get_part will give back the coordinates of a good candidate of either model, be it 1, 2, 3 or 4. The behavior is similar to the single part use case. However, the command will return parts of alternating models if possible.
Suppose the image analysis is completed and the system found 2 parts of each model. Calling get_part 4 times will result in a random sequence containing each model once (e.g.
4
,2
,1
,3
).Suppose now the system found 3 parts of model
1
and none of any other model. Calling get_part 3 times will return1
,1
,1
. Calling get_part a fourth time will trigger a feeding sequence and a new image analysis.
Working principle with part_quantity = 2
Parameters set to:
part_quantity = 2
model_quantity 1 0
model_quantity 2 0
model_quantity 3 0
model_quantity 4 0
This configuration changes the minimum number of good candidates of any model that must be found each time the get_part command is called. The quantity of parts can be changed with the command set_parameter.
The get_part command will not stop until getting at least 2 good candidates on the Asycube or reaching the timeout.
Suppose the image analysis is completed and the system found 2 parts of model
2
and 3 parts of model4
. Calling get_part once will result in a random output such as: (2
,4
). Again, there is no guarantee that the output will begin with2
so the output could just as well be (4
,2
) or even (4
,4
). After a second get_part that will return 2 good parts, only a single part would be available and since we requested a part_quantity of 2, the system will trigger a feeding sequence and new image analysis since.
Working principle with model_quantity = n
Parameters set to:
part_quantity = 1
model_quantity 1 0
model_quantity 2 1
model_quantity 3 0
model_quantity 4 0
In this case, since one of the model_quantity is different from zero, part_quantity is ignored. Here the system
will return one part of model 2
only.
Suppose again the image analysis is completed and the system found 3 parts of model
1
and 2 parts of model2
. Calling get_part 2 times will return the following sequence:2
,2
. Even though there are good candidates for model1
, none will be returned and a third call to get_part will trigger a feeding sequence and new image analysis to return a new candidate of model2
.
Parameters set to:
part_quantity = 1
model_quantity 1 1
model_quantity 2 0
model_quantity 3 1
model_quantity 4 0
Once again part_quantity is ignored since model_quantity is different from zero for several models. One part of
model 1
and one part of model 3
are requested at the same time now.
Taking our previous example where the image analysis is completed and the system found 2 parts of model
1
and 3 parts of model3
: calling get_part 2 times may return the following sequence: (1
,3
), (1
,3
). A third call to get_part will trigger a feeding sequence and new image analysis to return (1
,3
).
Note
As for part_quantity, it is possible to set model_quantity to values higher than 1. For example, if
2 parts of model 1
and 1 part of model 3
are needed in the same get_part call, model_quantity 1 must be
set to 2 and model_quantity 3 to 1.
Usage example
set_parameter part_quantity 2
set_parameter model_quantity 1 0
set_parameter model_quantity 2 0
set_parameter model_quantity 3 0
set_parameter model_quantity 4 0
get_part
200 x=0.58025 y=0.43782 rz=5.02 m=4 x=0.50617 y=0.29485 rz=0.00 m=1
get_part
200 x=0.47438 y=0.13729 rz=252.02 m=4 x=0.45598 y=0.51482 rz=0.00 m=3
get_part
200 x=0.31603 y=0.16358 rz=188.96 m=4 x=0.29393 y=0.53599 rz=0.00 m=3
set_parameter part_quantity 1
set_parameter model_quantity 1 1
set_parameter model_quantity 2 0
set_parameter model_quantity 3 0
set_parameter model_quantity 4 0
get_part
200 x=0.12345 y=0.11111 rz=0.99 m=1
get_part
200 x=0.67894 y=0.12341 rz=0.79 m=1
set_parameter part_quantity 1
set_parameter model_quantity 1 1
set_parameter model_quantity 2 0
set_parameter model_quantity 3 1
set_parameter model_quantity 4 0
get_part
200 x=0.12345 y=0.11111 rz=0.99 m=1 x=0.42420 y=0.75311 rz=0.75 m=3
get_part
200 x=0.78951 y=0.96514 rz=0.42 m=1 x=0.23554 y=0.14587 rz=0.51 m=3