/***************************************************************
 * PrPuma560.h
 *
 * This class provides the PUMA560 robot interface.
 *
 ****************************************************************/

/*
 * modification history
 *----------------------
 *
 * 09/02/98: K.C. Chang: created.
 */

#ifndef _PrPuma560_h
#define _PrPuma560_h

#define PR_PUMA560_ROBOT_REAL 0
#define PR_PUMA560_ROBOT_SIM  1
#define PR_PUMA560_POWER_OFF  0
#define PR_PUMA560_POWER_ON   1
#define PR_PUMA560_GRIPPER_CLOSE  2
#define PR_PUMA560_GRIPPER_OPEN   3

#include "PrGlobalDefn.h"
#include "matrix/PrVector6.h"

// Change the following #define to select which board/configuration
// to compile this library for.
#define BOARD_TO_USE PrIPBoardTRC

class PrRobot;
class PrIPBoardIntf;
class PrJointIntegrator;

class PrPuma560
{
 public:
  PrPuma560(char *paramFile, int choice = PR_PUMA560_ROBOT_SIM, int servoRate = 0);
  ~PrPuma560();

  // for sim robot
  void zero();
  void simulate(Float dt);
  void jointPos(const PrVector6 &q);
  void jointVel(const PrVector6 &dq);

  // for real robot
  void power(int p = PR_PUMA560_POWER_ON);

  // for both robots
  PrVector6 &jointPos();
  PrVector6 &jointVel();
  PrVector6 &computedTorque(const PrVector6 &tau_prime);
  void torque(const PrVector6 &tau);
  void gripper(int g = PR_PUMA560_GRIPPER_OPEN);

 private:
  const int choice_;
  const int servoRate_;
  const int noj_;
  PrRobot *robot_;
  PrIPBoardIntf *hwInterface_;
  PrJointIntegrator *integrator_;

  PrVector6 q_;
  PrVector6 dq_;
  PrVector6 tau_;

  // copy is not allowed
  PrPuma560(const PrPuma560 &) : choice_(0), servoRate_(0), noj_(0) {};
};

#endif // _PrPuma560_h


