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-feeding recipe is used in production. Refer to get_part for standard, single part recipe.
Parameters
None
Returns
200 x=<x> y=<y> rz=<rz> p=<part>
, where<x>
,<y>
,<rz>
are coordinates and orientation of the part and<part>
is eithera
,b
,c
ord
depending on the part 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 of a specific type or not.
In the context of multi-feeding, this command can be used to retrieve the position of one or more specific parts
(e.g. one part a
and one part d
) or any pickable parts (e.g. part a
or part c
). This behavior is
controlled by the part_quantity parameter and the multi-feeding specific
multi_part_quantity parameter.
By default, these parameters are set to:
part_quantity = 1
multi_part_quantity a = 0
multi_part_quantity b = 0
multi_part_quantity c = 0
multi_part_quantity d = 0
If multi_part_quantity a, multi_part_quantity b, multi_part_quantity c and multi_part_quantity d are set to
zero, any pickable part will be returned, either of type a
, b
, c
or d
. The system will try to return
positions in an alternating way (e.g. a
, b
, a
, b
, etc for 2 parts). As for single part recipes, the
number of part returned can be changed using the part_quantity parameter (refer to
Table 25).
As soon as multi_part_quantity is set to a value greater than zero, part_quantity will be ignored and the number of
specific parts requested will be returned by get_part. This can be used e.g. to only retrieve parts of type a
or
get positions for multiple types (e.g. a
, b
and c
) at the same time.
Note
Notice that changing part_quantity or multi_part_quantity 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 cannot be found after the time period. The timeout can be adjusted before calling get_part (refer to set_parameter).
Though all that follows assumes a scenario with two parts (a
and b
), the principle remains the same with more
parts.
Default working principle
Parameters set to:
part_quantity = 1
multi_part_quantity a = 0
multi_part_quantity b = 0
The command get_part will give back the coordinates of a good candidate, be it of type a
or type b
. The
behavior is similar to the single part use case. However, the command will return part of alternating
types if possible.
Suppose the image analysis is completed and the system found 2 parts of type
a
and 3 parts of typeb
. Calling get_part 5 times will likely return the following sequence:a
,b
,a
,b
,b
. There is no guarantee that the sequence begins witha
so the output could beb
,a
,b
,a
,b
. The system will not trigger a new feeding sequence until all good candidates have been returned.Suppose now the system found 3 parts of type
a
and none of typeb
. Calling get_part 3 times will returna
,a
,a
. Calling get_part a fourth time will trigger a feeding sequence and a new image analysis.
Working principle with part_quantity = n
Parameters set to:
part_quantity = 2
multi_part_quantity a = 0
multi_part_quantity b = 0
It changes the minimum number of good candidates of any type 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 n good candidates on the Asycube or reaching the timeout.
Suppose the image analysis is completed and the system found 2 parts of type
a
and 3 parts of typeb
. Calling get_part 2 times will likely return the following sequence: (a
,b
), (a
,b
). Again, there is no guarantee that the sequence begins witha
so the output could be (b
,a
), (b
,a
). A third call to get_part will trigger a feeding sequence and new image analysis since only a single part would be available and we requested a part_quantity of 2.
Working principle with multi_part_quantity = n
Parameters set to:
part_quantity = 1
multi_part_quantity a = 1
multi_part_quantity b = 0
In this case, since one of the multi_part_quantity is different than zero, part_quantity is ignored. Here the system
will return only part of type a
.
Suppose again the image analysis is completed and the system found 2 parts of type
a
and 3 parts of typeb
. Calling get_part 2 times will return the following sequence:a
,a
. Even though there are good candidates for typeb
, none will be return and a third call to get_part will trigger a feeding sequence and new image analysis to return a new candidate of typea
.
Parameters set to:
part_quantity = 1
multi_part_quantity a = 1
multi_part_quantity b = 1
Again here part_quantity is ignored since multi_part_quantity are different than zero. One part of type a
and
one part of type b
are requested at the same time now.
Taking our previous example where the image analysis is completed and the system found 2 parts of type
a
and 3 parts of typeb
. Calling get_part 2 times will return the following sequence: (a
,b
), (a
,b
). A third call to get_part will trigger a feeding sequence and new image analysis to return (a
,b
).
Note
As for part_quantity, it is possible to set multi_part_quantity to values higher than 1. For example, if
2 parts a
and 1 part b
are needed in the same get_part call, multi_part_quantity a must be set to 2 and
multi_part_quantity b to 1.
Usage example
set_parameter part_quantity 2
set_parameter multi_part_quantity a 0
set_parameter multi_part_quantity b 0
get_part
200 x=0.12345 y=0.11111 rz=0.99 p=a x=0.42420 y=0.75311 rz=0.75 p=b
get_part
200 x=0.78951 y=0.96514 rz=0.42 p=b x=0.23554 y=0.14587 rz=0.51 p=b
set_parameter part_quantity 1
set_parameter multi_part_quantity a 1
set_parameter multi_part_quantity b 0
get_part
200 x=0.12345 y=0.11111 rz=0.99 p=a
get_part
200 x=0.67894 y=0.12341 rz=0.79 p=a
set_parameter part_quantity 1
set_parameter multi_part_quantity a 1
set_parameter multi_part_quantity b 1
get_part
200 x=0.12345 y=0.11111 rz=0.99 p=a x=0.42420 y=0.75311 rz=0.75 p=b
get_part
200 x=0.78951 y=0.96514 rz=0.42 p=a x=0.23554 y=0.14587 rz=0.51 p=b