configToStr(3)

NAME
configToStr, strToConfig -- RCI routines to convert robot configuration bit-codes to strings, and vice versa.

USAGE
char *configToStr (string, conf, kyn)
   char *string;
   unsigned long conf;
   KYN *kyn;

unsigned long strToConfig (confp, string, kyn)
   unsigned long *confp;
   const char *string;
   KYN *kyn;

ARGUMENTS

string --
    String description of the robot configuration.

conf --
    Bitmask description of configuration.

confp --
    Pointer to bitmask description of configuration.

kyn --
    Robot's KYN structure (see below).

DESCRIPTION
These routines may be called from any part of an RCI program.

A robot's position in space is usually characterized by kinematic redundancies. A six degree of freedom serial robot manipulator has at most 32 distinct solutions (a result first established by Bernie Roth). The RCCL/RCI kinematic routines usually use a bit code to decsribe these redundancies (for 6 DOF robots, one needs at most 5 bits, given the 32 solutions).

This bit code is not overly user friendly, however. Some parts of RCCL use a string code instead, assigning a pair of letters to each "bit" of the configuration. These routines map between the two representations for the robots supported by RCI.

configToStr() takes a configuration code and returns a string describing it.

strToConfig() takes a (possibly incomplete) string describing a configuration and computes a configuration code which it puts in "confp"; it also returns a bitmask corresponding to those elements of the configuration which were in fact specified.

The file h/<class>_kynvar.h defines the configuration codes for a particular robot class.

As an example, the configurations for PUMA are described as follows:
      Bit code          Meaning             Characters

   PUMA_RIGHT_CONF  Right vs. left handed    'r' 'l'
   PUMA_DOWN_CONF   Elbow down vs. up        'd' 'u'
   PUMA_FLIP_CONF   Wrist flipped vs. not    'f' 'n'

These are defined in the file puma_kynvar.h. A configuration string implying that the robot was in the right handed, elbow up, no-wrist-flip configuration would then be "run". The order of the characters is not important if strToConf() is being called.

The kyn structure contains robot kinematic and dynamic constants. For full details on the KYN structure and how to obtain it, see the manual page KYN(3).

DIAGNOSTICS
strToConfig() returns -1 if the described configuration is illegal.

BUGS
The configuration code information ought to also contain information about joint redundancy. This could be done by packing a 6 4-bit codes into the configuration word (which is 32 bits on most machines), or by making the configuration code a structure.

SEE ALSO
KYN(3), fwdKinematics(3), fwdJacobian(3).