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

**URL:** <https://tech-community.robotics.abb.com/t/help-camera-programming-setting-robtargets-for-two-controllers-based-on-one-image-taken/8932>\
**Category:** RAPID Programming\
**Created:** [June 27, 2019, 1:49pm UTC](https://tech-community.robotics.abb.com/t/help-camera-programming-setting-robtargets-for-two-controllers-based-on-one-image-taken/8932 "2019-06-27T13:49:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![epysj1](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/epysj1/32/3361_2.png) [@epysj1](https://tech-community.robotics.abb.com/u/epysj1)\
**Post date:** [June 27, 2019, 1:49pm UTC](https://tech-community.robotics.abb.com/t/help-camera-programming-setting-robtargets-for-two-controllers-based-on-one-image-taken/8932/1 "2019-06-27T13:49:35Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![YuGo](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@YuGo](https://tech-community.robotics.abb.com/u/YuGo)\
**Post date:** [July 2, 2019, 9:31am UTC](https://tech-community.robotics.abb.com/t/help-camera-programming-setting-robtargets-for-two-controllers-based-on-one-image-taken/8932/2 "2019-07-02T09:31:34Z")

</div>

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**  
`  
TASK PERS tooldata tVison:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];

TASK PERS tooldata tGripper:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];

TASK PERS robtarget pPhoto:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

TASK PERS robtarget pPick:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

PERS wobjdata wbjVision:=[FALSE, TRUE, “”,[[0, 0, 0],[1, 0, 0, 0]],[[0,0,0],[1,0,0,0]]];

VAR cameratarget cT;

PROC moveToPhoto()

MoveL pPhoto,v1000,fine,tVison\WObj:=wobj0;

CamReqImage camL;

CamGetResult camL,cT;

wbjVision.oframe:=cT.cframe;

MoveL Offs(pPick,0,0,100),v1000,z10,tGripper\WObj:=wbjVision;

MoveL pPick,v1000,fine,tGripper\WObj:=wbjVision;

!..

! WaitSync with T\_ROB\_R

!..

ENDPROC

`

**T\_ROB\_R**

`TASK PERS tooldata tVison:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];`

`  
TASK PERS tooldata tGripper:=[TRUE,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];

TASK PERS robtarget pPhoto:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

TASK PERS robtarget pPick:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

PERS wobjdata wbjVision;

PROC moveToPhoto()

!..

! WaitSync with T\_ROB\_L

MoveL Offs(pPick,0,0,100),v1000,z10,tGripper\WObj:=wbjVision;

MoveL pPick,v1000,fine,tGripper\WObj:=wbjVision;

!..

` `ENDPROC`

I Hope that is clear.

BR, U.
