getRobotPosition(3)

NAME
getRobotPosition -- RCI database routine to get robot joint position.

USAGE
getRobotPosition (angles, posName, robotName)
  float *angles;
  const char *posName;
  const char *robotName;

ARGUMENTS

angles --
    Array to return the joint angles in. Angles are returned in radians.

posName --
    Name of the position. The name should be a string of alphanumerics (including underscores and dollar signs) that does not begin with a digit.

robotName --
    Name of the robot. The name should be a string of alphanumerics (including underscores and dollar signs) that does not begin with a digit.

RESTRICTIONS
This routine must be called from the planning level.

DESCRIPTION
This routines searches a database file in the directory $RCCL/conf for a joint angle position with the indicated name defined for the specified robot. The routine returns the number of robot joints if the position was found, 0 if it was not, and -1 if an error occured.

There is a separate position database file for each robot, with the name <robotName>.pos. Entries in the file look like:
pos1    90.0    90.0    0.0     0.0     45.0    28.0
pos2    90.0     0.0  -90.0     0.0     60.0  -180.0
                .               .
                .               .

The angles are described in degrees, although the routine will return them in radians. No conversion is applied to prismatic joints.

getRobotPosition() consults the robot's JLS structure (q.v.) to determine how many joints the robot has, and which (if any) are prismatic. This means that the robot must be known to the RCI system.

DIAGNOSTICS
The routine returns -1 in the event of error, or will force an exit if EXIT_ON_ERROR has been set (see rciSetOptions(3)). Error information is returned on the errorStack (q.v.). Error codes can be examined with the routine getErrorCode().

Error codes include:

EEnviron --
    The environment variable "RCCL" is not set.

EBadAccess --
    Can't access either the position database file or the robot's JLS data structure.

EBadObj --
    Position file is malformed.

EMemory --
    Program is out of memory.

The routine will abort the program if called from the control level.

SEE ALSO
JLS, rcclSetOptions(3), errorStack(3).