 
{ File ws.sil -  ( Workspace functions ) }
 
{ "workspace_box" constructs a box3dr which upper bounds the workspace of
  the  manipulator as a function of the current tool.  The box is
  expressed in the base frame of the manipulator. } 
 
{  Argument R is the robot object. }
function workspace_box_sx_13_19(r: object): box3dr;
var ee: object;
    toff: pnt3dr;
    tool_len,max: real;
begin
  ee:=end_effector_of(r);
  if not(ee = null_object) then toff:= pos(ee) in_frame wrist(r)
  else toff:= pos(flange_rel_wrist(r));
  tool_len:=length(toff);
  max:= tool_len + 2.140000000000001e+02;
  workspace_box_sx_13_19:=
           mk_box3dr( mk_bnds( -max, max ),
                      mk_bnds( -max, max ),
                      mk_bnds( -max + 4.640000000000003e+01, max + 4.640000000000003e+01 ) );
end;
