Hi,
I’m having some problems with RelTool command. I’m making a program with IRB120 where I try to pick products from tray and then place them into a pallet using data I get from camera. Products need to placed into pallet with specific angle and they are randomly placed on the tray where they are picked. I’m using Offs command to do every other movement where info from camera is needed because that way I can use workobject that has same coordinate system as the camera does but I still need to use reltool at one point to fix the angle. The problem is that reltool moves the robot in all directions even though it is only given permission to rotate around z-axis. The point where it tries to reach with reltool command seem to be pretty random but it’s always close to robots base. So why is it working like that? Here is a small sample of the code:
!First it moves to the products location and then picks it up
MoveL Offs(pKamera,nXOffset,nYOffset,60), v200, fine, tVacuum\WObj:=wobjPoiminta;
MoveL Offs(pKamera,nXOffset,nYOffset,7), v200, fine, tVacuum\WObj:=wobjPoiminta;
SetDO do2Vacuum, 1;
WaitTime 1;
MoveL Offs(pKamera,nXOffset,nYOffset,60), v200, fine, tVacuum\WObj:=wobjPoiminta;
!Robot moves above static pallet to the right position
MoveJ [[288.61,407.86,89.08],[0.019167,-0.999374,-0.0296428,0.00217687],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v100, fine, tVacuum\WObj:=wobjPoiminta;
!Here I try to correct the angle before placing the product into pallet but it all goes wrong right here
MoveL RelTool (pKamera, 0, 0, 0 \Rz:= nAngle2), v100, fine, tVacuum;
pKulma := CRobT(\Tool:=tVacuum \WObj:=wobjPoiminta);
MoveL Offs(pKulma,0,0,-20), v100, z0, tVacuum\WObj:=wobjPoiminta;
SetDO do2Vacuum, 0;
WaitTime 1;
MoveL Offs(pKulma,0,0,20), v100, z0, tVacuum\WObj:=wobjPoiminta;