 
{ 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_c5g_nj4_270_27(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 + 3.134995013260198e+002;
  workspace_box_c5g_nj4_270_27:=
           mk_box3dr( mk_bnds( -max, max ),
                      mk_bnds( -max, max ),
                      mk_bnds( -max + 1.140000000000000e+002, max + 1.140000000000000e+002 ) );
end;
