encoderToAngle(3)

NAME
encoderToAngle, angleToEncoder, encoderToJoint, jointToEncoder, mtorqueToJtorque, jtorqueToMtorque -- generic RCI actuator to joint conversion routines.

USAGE
#include <rci.h>

encoderToAngle(ang, enc, jls)
   float *ang;
   int *enc;
   JLS *jls;

angleToEncoder(enc, ang, jls)
   int *enc;
   float *ang;
   JLS *jls;

encoderToJoint(ang, enc, jls)
   float *ang;
   int *enc;
   JLS *jls;

jointToEncoder(enc, ang, jls)
   int *enc;
   float *ang;
   JLS *jls;

mtorqueToJtorque(jtor, mtor, jls)
   float *jtor, *mtor;
   JLS *jls;

jtorqueToMtorque(mtor, jtor, jls)
   float *mtor, *jtor;
   JLS *jls;

ARGUMENTS

ang --
    Array of angle values or angle displacements (radians or mm.).

enc --
    Array of encoder values or encoder displacements.

jls --
    Pointer to JLS structure.

mtor --
    Array of motor torque values (Newton-meters or Newtons).

jtor --
    Array of joint force values (Newton-meters or Newtons).

DESCRIPTION
These routines transform position, displacement (velocity), and torque between actuator and joint coordinates for a robot described by a JLS structure (q.v.). They may be called from any part of an RCI program.

The routines make use of the various conversion matrices specified in the JLS structure. Although they will work for any robot that is well-defined by the information in JLS, they are not particularly fast. Consequently, it is desirable to write robot specific versions of these functions that live in the structure (this has been done for the PUMA robot). Such routines should conform to the interface described here.

encoderToAngle() translates encoder values to joint angles, subtracting the offset values described in the encOffset field of the JLS structure, and then multiplying by the conversion factors in the enctoang matrix.

angleToEncoder() translates angle values to encoder values, multiplying by the conversion factors in the angtoenc matrix of the JLS structure, and then adding the offsets described in the encOffset field.

encoderToJoint() translates encoder displacements to angle displacements, multiplying by conversion factors in the enctoang matrix of the JLS structure.

jointToEncoder() translates angle displacements to encoder displacements, multiplying by the conversion factors in the angtoenc matrix of the JLS structure.

mtorqueToJtorque() translates motor torques to joint torques, multiplying by the gear ratios in the forGearRatios matrix of the JLS structure.

jtorqueToMtorque() translates joint torques to motor torques, dividing by the gear ratios in the forGearRatios matrix of the JLS structure.

A note relating to the implementation of the routines: The above mentioned matrix fields are stored in a compact form consisting of a list of the diagonal elements, followed the non-zero off-diagonal terms arranged in row-column order. The number of off-diagonal (coupling) terms, and the indices corresponding to them, are described by other fields in the JLS structure.

SEE ALSO
getJls(3), JLS(3).