Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

ArGripper.h

00001 /*
00002 ActivMedia Robotics Interface for Applications (ARIA)
00003 Copyright (C) 2004,2005 ActivMedia Robotics, LLC
00004 
00005 
00006      This program is free software; you can redistribute it and/or modify
00007      it under the terms of the GNU General Public License as published by
00008      the Free Software Foundation; either version 2 of the License, or
00009      (at your option) any later version.
00010 
00011      This program is distributed in the hope that it will be useful,
00012      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014      GNU General Public License for more details.
00015 
00016      You should have received a copy of the GNU General Public License
00017      along with this program; if not, write to the Free Software
00018      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 If you wish to redistribute ARIA under different terms, contact 
00021 ActivMedia Robotics for information about a commercial version of ARIA at 
00022 robots@activmedia.com or 
00023 ActivMedia Robotics, 19 Columbia Drive, Amherst, NH 03031; 800-639-9481
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

Generated on Wed Oct 19 12:56:35 2005 for Aria by  doxygen 1.4.0