 
{ File em.sil -  ( Emulate maps ) }
 
 
{ Emulate maps for sx_13_19 }
 
 
{  This function computes the joint vector in the CIM }
{  convention.  The argument GUY is the robot object. }
{  The argument J is the current joint vector in the  }
{  EXTERNAL convention.                               }
function sx_13_19_to_cim_jvr(guy:object;j:jvr): jvr;
var z: darray of real;
begin
  z:= joint_r_parms(guy,0);   { index #0 = "JZERO }
  sx_13_19_to_cim_jvr:= [ 
                 j[1] + z[0],
                 j[2]-1.570796326794895e+00 + z[1],
                 j[3] + 1.570796326794899e+00 + z[2],
                 j[4]-3.141592653589786e+00 + z[3],
                 j[5]-3.141592653589786e+00 + z[4],
                 j[6] + z[5] ] as jvr;
end;
 
 
{  This function computes the joint vector in the EXTERNAL }
{  convention.  The argument GUY is the robot object. The  }
{  argument J is the current joint vector in the CIM       }
{  convention.                                             }
function cim_to_sx_13_19_jvr(guy:object;j:jvr): jvr;
var z: darray of real;
begin
  z:= joint_r_parms(guy,0);   { index #0 = "JZERO }
  cim_to_sx_13_19_jvr:= [ 
                 j[1] - z[0],
                 j[2] + 1.570796326794895e+00 - z[1],
                 j[3]-1.570796326794899e+00 - z[2],
                 j[4] + 3.141592653589786e+00 - z[3],
                 j[5] + 3.141592653589786e+00 - z[4],
                 j[6] - z[5] ] as jvr;
end;
