RobotStudio event

[HELP] Camera Programming: setting robtargets for two controllers based on one image taken

Options
Hi all,

I am using a YuMi IRB14000 robot. My sequence includes moving both of the right and left arm to taught positions based on the photo which YuMi takes using its right arm.  At the moment, YuMi needs to take photo twice in order to move to desired positions for both arms. Does anyone know what to do in order to program the arms to vision taught targets based on one image (so that YuMi does not need to take the photo twice)? 

Many thanks!


Comments

  • YuGo
    YuGo
    edited July 2019
    Options
    Hi @epysj1
    Just declare the workobject modifided by your vision job in the both tasks and modify the robtarget when the workobject is set.
    Example:
    T_ROB_L
    <div>&nbsp; &nbsp; TASK PERS tooldata tVison:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];<br><br></div><div>&nbsp; &nbsp; TASK PERS tooldata tGripper:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];<br><br></div><div>&nbsp; &nbsp; TASK PERS robtarget pPhoto:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];<br><br></div><div>&nbsp; &nbsp; TASK PERS robtarget pPick:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];<br><br></div><div>&nbsp; &nbsp; PERS wobjdata wbjVision:=[FALSE, TRUE, "",[[0, 0, 0],[1, 0, 0, 0]],[[0,0,0],[1,0,0,0]]];<br><br></div><div>&nbsp; &nbsp; VAR cameratarget cT;</div><div>&nbsp; &nbsp;&nbsp;<br><br></div><div>&nbsp; &nbsp; PROC moveToPhoto()<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; MoveL pPhoto,v1000,fine,tVison\WObj:=wobj0;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; CamReqImage camL;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; CamGetResult camL,cT;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; wbjVision.oframe:=cT.cframe;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; MoveL Offs(pPick,0,0,100),v1000,z10,tGripper\WObj:=wbjVision;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; MoveL pPick,v1000,fine,tGripper\WObj:=wbjVision;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; !..<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; ! WaitSync with T_ROB_R<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; !..<br><br></div><div>&nbsp; &nbsp; ENDPROC<br><br></div><br>

    T_ROB_R

    &nbsp; &nbsp; TASK PERS tooldata tVison:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];<br><br><div><b>&nbsp; &nbsp; </b>TASK PERS tooldata tGripper:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];<br><br></div><div>&nbsp; &nbsp; TASK PERS robtarget pPhoto:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];<br><br></div><div>&nbsp; &nbsp; TASK PERS robtarget pPick:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];<br><br></div><div>&nbsp; &nbsp; PERS wobjdata wbjVision;</div><div>&nbsp; &nbsp;&nbsp;<br><br></div><div>&nbsp; &nbsp; PROC moveToPhoto()<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; !..<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; !&nbsp;WaitSync with T_ROB_L<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; MoveL Offs(pPick,0,0,100),v1000,z10,tGripper\WObj:=wbjVision;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; MoveL pPick,v1000,fine,tGripper\WObj:=wbjVision;<br><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; !..<br><br></div>
    &nbsp; &nbsp; ENDPROC<br><br>
    I Hope that is clear.

    BR, U.