I know how use the world zone command to create a sphere or a box, but I don’t know how to check if a world volume is within the work envelope of my robot.
What I’m try to do is find the largest sphere that fit in the work envelope, not including the space behind the robot.
! Test if a position is reachable
FUNC bool IsReachable(INOUT robtarget pCheck, PERS tooldata tCheck\ PERS wobjdata wCheck)
VAR jointtarget joint;
VAR robtarget target;
VAR errnum enRes;
IF Present(wCheck) THEN
joint:=CalcJointT(pCheck,tCheck\WObj:=wCheck\ErrorNumber:=enRes);
target:=CalcRobT(joint,tCheck\WObj:=wCheck);
pCheck.robconf:=target.robconf;
ELSE
joint:=CalcJointT(pCheck,tCheck\ErrorNumber:=enRes);
target:=CalcRobT(joint,tCheck);
pCheck.robconf:=target.robconf;
ENDIF
RETURN enRes=0;
!ERR_ROBLIMIT, ERR_OUTSIDE_REACH, ERR_WOBJ_MOVING
ERROR
IF (ERRNO = ERR_ROBLIMIT) OR (ERRNO = ERR_WOBJ_MOVING) RETURN FALSE;
ErrWrite\I, "IsReachable","Unmanaged Error:"\RL2:=ValToStr(ERRNO);
Stop;
ENDFUNC
Calling this function, you can test if a robtarget is reachable and return robconf.
So for you, you have to check each corner of your shape.