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 #ifndef ARGRIPPER_H
00027 #define ARGRIPPER_H
00028
00029 #include "ariaTypedefs.h"
00030 #include "ArRobot.h"
00031
00033
00040 class ArGripperCommands
00041 {
00042 public:
00043 enum Commands {
00044 GRIP_OPEN = 1,
00045 GRIP_CLOSE = 2,
00046 GRIP_STOP = 3,
00047 LIFT_UP = 4,
00048 LIFT_DOWN = 5,
00049 LIFT_STOP = 6,
00050 GRIPPER_STORE = 7,
00054 GRIPPER_DEPLOY = 8,
00059 GRIPPER_HALT = 15,
00060 GRIP_PRESSURE = 16,
00065 LIFT_CARRY = 17
00070 };
00071 };
00072
00074 class ArGripper
00075 {
00076 public:
00078 AREXPORT ArGripper(ArRobot *robot, int gripperType = QUERYTYPE);
00080 AREXPORT virtual ~ArGripper();
00082 AREXPORT bool gripOpen(void);
00084 AREXPORT bool gripClose(void);
00086 AREXPORT bool gripStop(void);
00088 AREXPORT bool liftUp(void);
00090 AREXPORT bool liftDown(void);
00092 AREXPORT bool liftStop(void);
00094 AREXPORT bool gripperStore(void);
00096 AREXPORT bool gripperDeploy(void);
00098 AREXPORT bool gripperHalt(void);
00100 AREXPORT bool gripPressure(int mSecIntervals);
00102 AREXPORT bool liftCarry(int mSecIntervals);
00104 AREXPORT bool isGripMoving(void) const;
00106 AREXPORT bool isLiftMoving(void) const;
00108 AREXPORT int getGripState(void) const;
00110 AREXPORT int getPaddleState(void) const;
00112 AREXPORT int getBreakBeamState(void) const;
00114 AREXPORT bool isLiftMaxed(void) const;
00116 AREXPORT int getType(void) const;
00118 AREXPORT void setType(int type);
00120 AREXPORT long getMSecSinceLastPacket(void) const;
00122 AREXPORT int getGraspTime(void) const;
00124 AREXPORT void logState(void) const;
00126 AREXPORT bool packetHandler(ArRobotPacket *packet);
00128 AREXPORT void connectHandler(void);
00130 enum Type {
00131 QUERYTYPE,
00132 GENIO,
00133 USERIO,
00134 GRIPPAC,
00135 NOGRIPPER
00136 };
00137 protected:
00138 ArRobot *myRobot;
00139 int myType;
00140 unsigned char myState;
00141 unsigned char mySwitches;
00142 unsigned char myGraspTime;
00143 ArTime myLastDataTime;
00144 ArFunctorC<ArGripper> myConnectCB;
00145 ArRetFunctor1C<bool, ArGripper, ArRobotPacket *> myPacketHandlerCB;
00146 };
00147
00148
00149 #endif // ARGRIPPER_H