/***************************************************************
 * PrIPBoardIntf.h
 *
 * This is a pure abstract interface class for hardware IP board.
 *
 ****************************************************************/

/*
 * modification history
 *----------------------
 *
 * 12/19/97: K.C. Chang: created.
 */

#ifndef _PrIPBoardIntf_h
#define _PrIPBoardIntf_h

#define PR_IPBOARDINTF_OK    1
#define PR_IPBOARDINTF_ERROR 0

class PrForceSensorIntf;
class PrAccelSensorIntf;
class ServoToGo;

class PrIPBoardIntf
{
 public:
    // error checking for constructor
    virtual int flag() = 0;

    // hardware reset
    virtual int zero() = 0;

    virtual int powerOn() = 0;
    virtual int powerOff() = 0;
    virtual int thermostat() = 0;
    virtual int calibrationCheck() = 0;
    virtual int calibrationSet() = 0;

    // set torques(force) for base and arm
    virtual int jointForce(Float *tau) = 0;

    // set torques for arm
    virtual int jointForceArm(Float *tau) = 0;

    // set force for base
    virtual int jointForceBase(Float *tau) = 0;

    // set force for gripper
    virtual int gripperForce(Float *tau) = 0;

    // read angles(distance) for base and arm
    virtual int jointPosition(Float *q) = 0;

    // read angles for arm
    virtual int jointPositionArm(Float *q) = 0;

    // read distance for base
    virtual int jointPositionBase(Float *q) = 0;

    // read distance for gripper
    virtual int gripperPosition(Float *q) = 0;

    virtual int jointVelocity(Float *q,Float *dq) = 0;
    virtual int jointVelocityArm(Float *q,Float *dq) = 0;
    virtual int jointVelocityBase(Float *q,Float *dq) = 0;
    virtual int gripperVelocity(Float *q,Float *dq) = 0;

    // Set the gripper position
    virtual int handOpen( void ) { return 0; }
    virtual int handClose( void ) { return 0; }

    // Get a handle on the force sensor.
    virtual PrForceSensorIntf * forceSensor( void ) = 0;

    // read force from the force sensor
    virtual int forceSensor(Float *f) = 0;

    // zero the force sensor
    virtual int forceSensorZero() = 0;

    // Get a handle on the accel sensor.
    virtual PrAccelSensorIntf * accelSensor( void ) = 0;

    // read accel from the accel sensor
    virtual int accelSensor(Float *f) = 0;

    // zero the accel sensor
    virtual int accelSensorZero() = 0;

    virtual ServoToGo* GetBoard() { return NULL; }
};

#endif // _PrIPBoardIntf_h
