/***************************************************************
 * PrTreeRobot.h
 *
 * This class provides the tree-like robot interface.
 *
 ****************************************************************/

/*
 * modification history
 *----------------------
 *
 * 10/06/98: K.C. Chang: created.
 */

#ifndef _PrTreeRobot_h
#define _PrTreeRobot_h

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

class PrRobot;
class PrJointState;
class PrJointIntegrator;
class PrDataInput;
class PrVector;

class PrTreeRobot : public PrTreeRobotIntf
{
public:
  PrTreeRobot(int noj,char *paramFilename);

	virtual ~PrTreeRobot();
	virtual int noj() const;
	virtual int mode() const { return mode_; } 
	virtual void mode(int m) { mode_ = m; }
	virtual int modeGripper() const { return emode_; } 
	virtual void modeGripper(int m) { emode_ = m; }
	virtual void jointPos(const PrVector &q);
	virtual void jointVel(const PrVector &dq);
	virtual PrVector &jointPos();
	virtual PrVector &jointVel();
	virtual PrVector &computedTorque(const PrVector &tau_prime);
	virtual void torque(const PrVector &tau);

	virtual Float gripperPos();
	virtual Float gripperVel();
	virtual void gripperTorque(Float t);
	virtual PrVector6 &fsValue();
	virtual void fsZero();

	virtual PrRobot *robot() { return robot_; } 
	
	// for sim robot
	void zero();
	void simulate(Float dt);

	PrJointState *jointState();
	
	void display();
	
  private:
	int mode_;
	int emode_;
	PrRobot *robot_;
	PrJointIntegrator *integrator_;
	
	PrVector *q_;
	PrVector *dq_;
	PrVector *tau_;
	PrVector6 f_;

	// copy is not allowed
	PrTreeRobot(const PrTreeRobot &) {}
};

#endif							// _PrTreeRobot_h



