 
{ File em.sil -  ( Emulate maps ) }
 
 
{ Emulate maps for c5g_nj_130_37sh }
 
 
{  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 c5g_nj_130_37sh_to_cim_jvr(guy:object;j:jvr): jvr;
var z: darray of real;
begin
  z:= joint_r_parms(guy,0);   { index #0 = "JZERO }
  c5g_nj_130_37sh_to_cim_jvr:= [ 
                 j[1] + z[0],
                 j[2]-1.570796326794897e+000 + z[1],
                 j[3] + 3.141592653589794e+000 + z[2] + j[2]- 1.570796326794897e+000,
                 j[4]-3.141592653589790e+000 + z[3],
                 j[5]-3.141592653589790e+000 + 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_c5g_nj_130_37sh_jvr(guy:object;j:jvr): jvr;
var z: darray of real;
begin
  z:= joint_r_parms(guy,0);   { index #0 = "JZERO }
  cim_to_c5g_nj_130_37sh_jvr:= [ 
                 j[1] - z[0],
                 j[2] + 1.570796326794897e+000 - z[1],
                 j[3]-3.141592653589794e+000 - z[2] -                  j[2]-1.570796326794897e+000 + z[1] +1.570796326794897e+000,
                 j[4] + 3.141592653589790e+000 - z[3],
                 j[5] + 3.141592653589790e+000 - z[4],
                 j[6] - z[5] ] as jvr;
end;
