\input manualMacros.tex
\manBegin
\manPageInfo{RCI Reference Manual}{}{}
\manTitle{SET POWER ON}{3}
\manSection{NAME}
{\raggedright
{\tt \manName{SET_POWER_ON}},
{\tt \manName{SET_POWER_OFF}},
{\tt \manName{SET_INTEGRATION}},
{\tt \manName{SET_\-CALIB\-MODE}},
{\tt \manName{SET_\-CALIB\-FLAG}}
-- RCI {\it CHG} macros to control robot operation.

}
\manSection{USAGE}
\cverbatim
#include <rci.h>

SET_POWER_ON(rbt)
   RCI_RBT *rbt;

SET_POWER_OFF(rbt)
   RCI_RBT *rbt; 

SET_INTEGRATION(rbt, mask)
   RCI_RBT *rbt;
   unsigned long mask;

SET_CALIBMODE(rbt, mask)
   RCI_RBT *rbt;
   unsigned long mask;

SET_CALIBFLAG(rbt, val)
   RCI_RBT *rbt;
   int val; @endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt rbt} --}
Pointer to RCI robot structure.
\manItem{{\tt mask} --}
Bitmask describing which joints the attribute should be set for.
\manItem{{\tt val} --}
User defined value.
\manSection{DESCRIPTION}
These macros control various discrete aspects of the robot controller
operation. They may be called from any part of an RCI program.

Some of these macros (especially those involving calibration) 
may not be implemented for a particular robot.

{\tt SET_POWER_ON()} instructs the robot controller to turn power on during
the next control cycle. 

{\tt SET_POWER_OFF()} instructs the robot controller to turn power off during
the next control cycle.

When robot power is on, the {\tt power} field of
the {\tt HOW} structure is set true.

{\tt SET_INTEGRATION()} instructs the robot controller to enable
integration servoing in all the joints specified by {\tt mask}.
The exact meaning of this will vary from controller to controller, although
in general it is assumed that integration servoing implies the usual
advantage of low static error at the cost of less stability.
The {\tt mask} settings may be read back in the {\tt integration}
field of the {\tt HOW} structure.

{\tt SET_CALIBMODE()} instructs the robot controller to place the
joints indicated by {\tt mask} into calibration mode. 
The {\tt mask} settings may be read back in the {\tt calibMode}
field of the {\tt HOW} structure.

The meaning
of calibration mode will vary from robot to robot. On the PUMA robot, it
means that the joint will continue to move in response to motion requests
{\it until} it encounters an encoder reference mark. At this point,
the joint will freeze, and not respond to any further requests
until an encoder value has been loaded into it with the 
{\tt SET_ENCODER()} command. A bit corresponding to the
joint in question will be set in the {\tt markFound} field of the
{\tt HOW} structure; this bit is automatically cleared when 
the {\tt SET_ENCODER()} command is called for that joint. 

{\tt SET_CALIBFLAG()} sets the calibration flag in the
robot controller, 
from which it is read back into the {\tt calibrated} field of the
{\tt HOW} structure. The purpose of the calibration flag is to
indicate whether or not the robot is calibrated. The flag is stored
in the robot controller, so as to make it easy to keep the value
of the variable in sync with whether the robot really is calibrated:
if the controller is powered off, the robot will lose calibration and
the variable will be cleared.
This macro is used only by calibration software.

Joint mask patterns map joint 1 onto bit 0, joint 2 onto bit 1,
etc. Bit settings for non-existent joints are ignored, so the
construct {\tt (unsigned long)\~0} will select all available joints.
\manSection{SEE ALSO}
\raggedright
{\tt CHG(3)}, {\tt HOW(3)}.
\manEnd
\end
