Hi,
I'm doing a vision based project. The 3D camera gives the coordinates to the robot. Before moving to the position I need to check whether the robot can able to reach the position or not. I'm using reltool function to pick the object. Code as follows,
jointpos := CalcJointT(pick_point, suction \ErrorNumber:= reach); --> calculates the robot reach with respect to base.
IF reach = ERR_ROBLIMIT OR reach = ERR_OUTSIDE_REACH or reach = ERR_WOBJ_MOVING THEN
Stop;
ENDIF
movel RelTool ( pick_point , 0,0,-200) , v1000,fine,suction;
MoveL reltool (pick_point,0,0,0), v1000, z50, suction;
movel RelTool ( pick_point , 0,0,200) , v1000,fine,suction;
calcjoint function is calculating according to the base. This function unable to check the robot reach with relative to the tool. So, if the robot tries to move this position "50050, position out of reach" error pops up and robot stops. If the robot is unable to reach the position I want to skip picking the part.
Additional Information:
1. If the robot moves according to the base, the robot will able to reach the point.
2. But if the robot tries to move according to tool to the same position it cannot reach the point because of the 5th axis limit. pls, find the attached video.
I tried error handling too. But I'm unable to handle the error.
PROC err()
count := count +1;
movel RelTool ( pick_point , 0,0,-200) , v1000,fine,suction;
MoveL reltool (pick_point,0,0,0), v1000, z50, suction;
movel RelTool ( pick_point , 0,0,200) , v1000,fine,suction;
! SetGO go,www;
ERROR
IF ERRNO = 50050 THEN
count := count +1;
Stop;
ENDIF
ENDPROC
ENDMODULE
Pls, let me know if I missed something.
Thanks,
Robotfreak