Home› Robotiq Products
Discussion
Back to discussions page
jcontreras
Posts: 5 Apprentice
Limit the number of attempts and/or time allowed to identify an object |
33 views
|
Answered | |
/ Most recent by jcontreras |
4 comments |

hello!
Can i limit the number of attempts or time the camera requires to identify an object.
I want to build a program where if the object is not located after 3 attemps or after 15seconds the UR will grab the product and place it in separate bin.
thank you and best regards
Tagged:
Best Answer
-
David_Gariepy Beta Tester Beetle, Wrist Camera URCap 1.3.0, Vacuum Beta tester Posts: 190 Handy
@jcontreras
Here is an example of an assembly using 2 different parts.
In this example, I use 4 differents variables, 2 for each part.
1 to keep track of the number of attempts, and 1 to define if the part has been found or not.
In the before start of the program, i initialized these variables.
My first camera locate is in an if statement.
If the number of attempts is below 3, and the part hasn't been found, the camera will take the first picture. if it find the part, it will set the variable to True, otherwise, it will continue the program and update the number of attempts +1
The second camera locate is also in an if statement
If the first part has been found, and the second hasn't yet, and the number of attempts to find that part is below 3, then take a picture.
if it find the part, it will set the variable part2_found to True, otherwise, it will continue the program and update the number of attempts +1Program BeforeStart part1_attempts≔0 part1_found≔ False part_2_attempts≔0 part2_found≔ False Robot Program MoveJ Snapshot_pos1 If part1_attempts<3 and part1_found≟ False Camera Locate MoveJ 'pick and place' part1_found≔ True part1_attempts≔part1_attempts+1 If (part1_found≟ True ) and (part2_found≟ False ) and (part_2_attempts<3) Camera Locate MoveJ 'pick and place' part2_found≔ True If part1_found≟ True and part2_found≟ True 'Program is finished, reset variables' part1_attempts≔0 part1_found≔ False part_2_attempts≔0 part2_found≔ False Else 'part not found, do something else' sync()
David Gariépy
Integration Coach
The camera locate nodes act as an if statement. If you detect an object (Camera Locate is "true) everything under the camera locate node is executed. You can then create simple logic to decide what do to. See the following DoF post for more details.
Integration Coach
but can a set the number of attempts it does?