00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ARGRIPPER_H
00028 #define ARGRIPPER_H
00029
00030 #include "ariaTypedefs.h"
00031 #include "ArRobot.h"
00032
00034
00041 class ArGripperCommands
00042 {
00043 public:
00044 enum Commands {
00045 GRIP_OPEN = 1,
00046 GRIP_CLOSE = 2,
00047 GRIP_STOP = 3,
00048 LIFT_UP = 4,
00049 LIFT_DOWN = 5,
00050 LIFT_STOP = 6,
00051 GRIPPER_STORE = 7,
00055 GRIPPER_DEPLOY = 8,
00060 GRIPPER_HALT = 15,
00061 GRIP_PRESSURE = 16,
00066 LIFT_CARRY = 17
00071 };
00072 };
00073
00075
00080 class ArGripper
00081 {
00082 public:
00084 ArGripper(ArRobot *robot, int gripperType = QUERYTYPE);
00086 virtual ~ArGripper();
00088 bool gripOpen(void);
00090 bool gripClose(void);
00092 bool gripStop(void);
00094 bool liftUp(void);
00096 bool liftDown(void);
00098 bool liftStop(void);
00100 bool gripperStore(void);
00102 bool gripperDeploy(void);
00104 bool gripperHalt(void);
00106 bool gripPressure(int mSecIntervals);
00108 bool liftCarry(int mSecIntervals);
00110 bool isGripMoving(void) const;
00112 bool isLiftMoving(void) const;
00114 int getGripState(void) const;
00116 int getPaddleState(void) const;
00118 int getBreakBeamState(void) const;
00120 bool isLiftMaxed(void) const;
00122 int getType(void) const;
00124 void setType(int type);
00126 long getMSecSinceLastPacket(void) const;
00128 int getGraspTime(void) const;
00130 void logState(void) const;
00132 bool packetHandler(ArRobotPacket *packet);
00134 void connectHandler(void);
00136 enum Type {
00137 QUERYTYPE,
00138 GENIO,
00139 USERIO,
00140 GRIPPAC,
00141 NOGRIPPER
00142 };
00143 protected:
00144 ArRobot *myRobot;
00145 int myType;
00146 unsigned char myState;
00147 unsigned char mySwitches;
00148 unsigned char myGraspTime;
00149 ArTime myLastDataTime;
00150 ArFunctorC<ArGripper> myConnectCB;
00151 ArRetFunctor1C<bool, ArGripper, ArRobotPacket *> myPacketHandlerCB;
00152 };
00153
00154
00155 #endif // ARGRIPPER_H