# Conveyor Tracking in IRC5 with IRB 360 - objects does not connect with "WaitWojb"

**URL:** <https://tech-community.robotics.abb.com/t/conveyor-tracking-in-irc5-with-irb-360-objects-does-not-connect-with-waitwojb/11151>\
**Category:** IRC5\
**Created:** [June 15, 2023, 5:48am UTC](https://tech-community.robotics.abb.com/t/conveyor-tracking-in-irc5-with-irb-360-objects-does-not-connect-with-waitwojb/11151 "2023-06-15T05:48:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hasala\_SR](https://avatars.discourse-cdn.com/v4/letter/h/ce7236/32.png) [@Hasala\_SR](https://tech-community.robotics.abb.com/u/Hasala_SR)\
**Post date:** [June 15, 2023, 5:48am UTC](https://tech-community.robotics.abb.com/t/conveyor-tracking-in-irc5-with-irb-360-objects-does-not-connect-with-waitwojb/11151/1 "2023-06-15T05:48:43Z")

</div>

I am trying to set up IRB 360 robot for conveyor tracking, using the option “conveyor tracking” and I am using our own camera system, where we process the images getting from the conveyor through a detection algorithm running in Python and send the selected coordinates to the robot controller via a socket communication.  
I have set up the CTM module, and encoder properly as described in the catalogue, but still struggling to properly do the conveyor tracking process.

Simply the process does not proceed after the “WaitWobj” instruction and my object does not get connected for tracking. The following is the simple code I used for this and would be glad to have your insights to rectify this issue.

Thanks.

MODULE MainModule

CONST robtarget p10:=[[347.89,-14.07,-8.29],[0.0944229,0.000809102,-0.00206603,-0.99553],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
PERS wobjdata ConveyorTest:=[FALSE,FALSE,“CNV1”,[[0,0,0],[1,0,0,0]],[[-1.10085,-59.0968,-1371.1],[0.66196,0.00689091,0.00729099,0.749472]]];  
!PERS wobjdata ConveyorTest:=[FALSE,FALSE,“CNV1”,[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];  
CONST wobjdata ConveyorTest1:=[FALSE,TRUE,“”,[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];  
VAR socketdev server\_socket;  
VAR socketdev client\_socket;  
VAR string HOST := “192.168.125.1”;  
VAR num PORT := 5050;  
VAR string receive\_string;  
VAR socketdev my\_socket;  
VAR num retry\_no := 0;  
VAR Bool SocketAccepted;

!From Camera Variables  
VAR bool flag1;  
VAR Bool ok;  
VAR Bool okConverter;  
VAR pos RawData;  
VAR string RecievedString;  
VAR pos data1;  
VAR pos sending\_pos;  
VAR pos test\_point;  
VAR pos picking\_string;

VAR num N\_CurrentDataX;  
VAR num N\_CurrentDataY;  
VAR num N\_CurrentDataZ;

VAR num N\_PreviousDataX;  
VAR num N\_PreviousDataY;  
VAR num N\_PreviousDataZ;

!!!SETTINGS!!!  
! Working Area Data

CONST num OffsMinX := 200;  
CONST num OffsMinY := 200;  
CONST num OffsMinZ := 5;  
CONST num OffsMaxX := 200;  
CONST num OffsMaxY := 200;  
CONST num OffsMaxZ := 5;

! Speed Data

VAR Bool B\_Status;  
CONST robtarget p20:=[[17.99,-32.40,164.96],[0.00062604,0.0960109,0.99533,-0.0100126],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickSafe:=[[17.96,-32.40,164.65],[0.000626221,0.0960292,0.995328,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget PickAbove:=[[17.96,-32.39,92.39],[0.000626581,0.096065,0.995324,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickPos:=[[17.58,-21.41,33.19],[0.000625441,0.0959516,0.995335,-0.0100126],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickAbove2:=[[17.96,-32.39,92.39],[0.000626581,0.096065,0.995324,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickPos2:=[[17.58,-21.41,33.19],[0.000625441,0.0959516,0.995335,-0.0100126],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickAbove3:=[[17.96,-32.39,92.39],[0.000626581,0.096065,0.995324,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickPos3:=[[17.58,-21.41,33.19],[0.000625441,0.0959516,0.995335,-0.0100126],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickAbove4:=[[17.96,-32.39,92.39],[0.000626581,0.096065,0.995324,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PickPos4:=[[17.58,-21.41,33.19],[0.000625441,0.0959516,0.995335,-0.0100126],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget PlaceSafe:=[[39.12,277.34,146.29],[0.000626221,0.0960292,0.995328,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PlaceAbove:=[[17.42,525.09,178.64],[0.000626221,0.0960292,0.995328,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget PlacePos:=[[17.42,525.08,77.37],[0.000626341,0.0960411,0.995327,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget Place\_close\_conveyor:=[[75.10,-19.06,24.15],[0.000627001,0.0961067,0.99532,-0.0100125],[0,1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC main()

! Create, bind, listen and accept of sockets in error handlers  
waittime 0.5;  
SocketClose server\_socket;  
SocketClose client\_socket;  
SocketCreate server\_socket;  
SocketBind server\_socket, HOST, PORT;  
SocketListen server\_socket;  
SocketAccept server\_socket, client\_socket\ClientAddress:=client\_ip;

AutoCycle:  
!server\_messaging;  
SetDO DO\_BlowerVSD,1;  
ActUnit CNV1;  
ConfL\off;  
SetDO DO\_ConveyorRun,1;

!setDo DO\_TrackSync,1;  
P\_CameraSequence;  
P\_Place;

GOTO AutoCycle;

ENDPROC

PROC P\_Pick()

WaitWObj ConveyorTest\RelDist:=0.5;  
MoveJ PickSafe, v2000, z50, Gripper\WObj:=ConveyorTest;  
MoveL Offs(Place\_close\_conveyor, picking\_string.x,picking\_string.y, picking\_string.z) , v1000, z50, Gripper\WObj:=ConveyorTest;  
SetDO DO\_VacuumSol, 0;  
waittime 0.5;

ENDPROC

PROC P\_Place()

MoveJ PlaceSafe, v2000, z50, Gripper\WObj:=ConveyorTest;  
MoveL PlaceAbove, v2000, z5, Gripper\WObj:=ConveyorTest;  
MoveL PlacePos, v2000, z0, Gripper\WObj:=ConveyorTest;  
SetDO DO\_VacuumSol, 1;  
WaitDI DI\_PressureSW,0;  
MoveL PlaceAbove, v500, z50, Gripper\WObj:=ConveyorTest;  
MoveJ PlaceSafe, v500, z50, Gripper\WObj:=ConveyorTest;

ENDPROC

PROC P\_CameraSequence()

StartTransfer:

WHILE receive\_string \<\> “PhotoTaken” DO  
SocketSend client\_socket \Str := “TakePhoto”;  
SocketReceive client\_socket \Str := receive\_string;  
waittime 0.5;

okConverter := StrToVal(receive\_string,picking\_string);  
!SetDo DO\_TrackSync,1;  
waittime 0.5;  
!SetDo DO\_TrackSync,0;

P\_Pick;  
P\_Place;

ENDWHILE

ENDPROC

ENDMODULE
