RobotStudio event

Is it possible to check if a shape is in the work envelope of a robot?

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.

Comments

  • I've done some more research and world zones might not be right tool, but I still need to find largest sphere that will fit in the work envelope.
  • soup
    soup ✭✭✭
    Right-click on the robot in RobotStudio > Layout tab and choose "Show Work Envelope".
  • Mechie
    Mechie
    edited March 2019
    Is a command allows rapid to do that? I'm trying to come up with a rapid code that can check multiple shapes
  • DenisFR
    DenisFR ✭✭✭
    Hello,
    I use this function:
    <code>tCheck\WObj:=<code>wCheck\ErrorNumber:=enRes);
          target:=CalcRobT(joint,<code>tCheck\WObj:=<code>wCheck);
          pCheck.robconf:=target.robconf;
        ELSE
          joint:=CalcJointT(pCheck,<code>tCheck\ErrorNumber:=enRes);
          target:=CalcRobT(joint,<code>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&nbsp; ! Test if a position is reachable<br>&nbsp; FUNC bool IsReachable(INOUT robtarget pCheck, PERS tooldata tCheck\ PERS wobjdata wCheck)<br>&nbsp;&nbsp;&nbsp; VAR jointtarget joint;<br>&nbsp;&nbsp;&nbsp; VAR robtarget target;<br>&nbsp;&nbsp;&nbsp; VAR errnum enRes;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; IF Present(wCheck) THEN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; joint:=CalcJointT(pCheck,
    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.