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

ArGripper Class Reference

A class of convenience functions for using the gripper. More...

#include <ArGripper.h>

List of all members.

Public Types

enum  Type {
  QUERYTYPE, GENIO, USERIO, GRIPPAC,
  NOGRIPPER
}
 These are the types for the gripper. More...

Public Member Functions

 ArGripper (ArRobot *robot, int gripperType=QUERYTYPE)
 Constructor.
void connectHandler (void)
 The handler for when the robot connects.
int getBreakBeamState (void) const
 Returns the state of the gripper's breakbeams.
int getGraspTime (void) const
 Gets the grasp time.
int getGripState (void) const
 Returns the state of the gripper paddles.
long getMSecSinceLastPacket (void) const
 Gets the number of mSec since the last gripper packet.
int getPaddleState (void) const
 Returns the state of each gripper paddle.
int getType (void) const
 Gets the type of the gripper.
bool gripClose (void)
 Closes the gripper paddles.
bool gripOpen (void)
 Opens the gripper paddles.
bool gripperDeploy (void)
 Puts the gripper in a deployed position, ready for use.
bool gripperHalt (void)
 Halts the lift and the gripper paddles.
bool gripperStore (void)
 Puts the gripper in a storage position.
bool gripPressure (int mSecIntervals)
 Sets the amount of pressure the gripper applies.
bool gripStop (void)
 Stops the gripper paddles.
bool isGripMoving (void) const
 Returns true if the gripper paddles are moving.
bool isLiftMaxed (void) const
 Returns the state of the lift.
bool isLiftMoving (void) const
 Returns true if the lift is moving.
bool liftCarry (int mSecIntervals)
 Raises the lift by a given amount of time.
bool liftDown (void)
 Lowers the lift to the bottom.
bool liftStop (void)
 Stops the lift.
bool liftUp (void)
 Raises the lift to the top.
void logState (void) const
 logs the gripper state
bool packetHandler (ArRobotPacket *packet)
 Parses the gripper packet.
void setType (int type)
 Sets the type of the gripper.
virtual ~ArGripper ()
 Destructor.

Protected Attributes

ArFunctorC< ArGrippermyConnectCB
unsigned char myGraspTime
ArTime myLastDataTime
ArRetFunctor1C< bool, ArGripper,
ArRobotPacket * > 
myPacketHandlerCB
ArRobotmyRobot
unsigned char myState
unsigned char mySwitches
int myType


Detailed Description

A class of convenience functions for using the gripper.

The commands which start with grip are for the gripper paddles, the ones which start with lift are the for the lift, and the ones which start with gripper are for the entire unit.

Definition at line 80 of file ArGripper.h.


Member Enumeration Documentation

enum ArGripper::Type
 

These are the types for the gripper.

Enumeration values:
QUERYTYPE  Finds out what type from the robot, default.
GENIO  Uses general IO.
USERIO  Uses the user IO.
GRIPPAC  Uses a packet requested from the robot.
NOGRIPPER  There isn't a gripper.

Definition at line 136 of file ArGripper.h.


Constructor & Destructor Documentation

ArGripper::ArGripper ArRobot robot,
int  gripperType = QUERYTYPE
 

Constructor.

Parameters:
robot The robot this gripper is attached to
useGenIO Whether the gripper on this robot is using GenIO or not

Definition at line 36 of file ArGripper.cpp.

References ArRobot::addConnectCB(), ArRobot::addPacketHandler(), ArRobot::comInt(), GRIPPAC, ArRobot::isConnected(), QUERYTYPE, and ArTime::setToNow().


Member Function Documentation

int ArGripper::getBreakBeamState void   )  const
 

Returns the state of the gripper's breakbeams.

Returns:
0 if no breakbeams broken, 1 if inner breakbeam broken, 2 if outter breakbeam broken, 3 if both breakbeams broken

Definition at line 338 of file ArGripper.cpp.

References GENIO, ArRobot::getAnalogPortSelected(), ArRobot::getDigIn(), GRIPPAC, ArLog::log(), NOGRIPPER, QUERYTYPE, and USERIO.

Referenced by logState(), and ArModeGripper::userTask().

int ArGripper::getGraspTime void   )  const
 

Gets the grasp time.

If you are using this as anything other than GRIPPAC and you want to find out the grasp time again, just do a setType with QUERYTYPE and it will query the robot again and get the grasp time from the robot.

Returns:
the number of 20 MSec intervals the gripper will continue grasping for after both paddles are triggered

Definition at line 540 of file ArGripper.cpp.

int ArGripper::getGripState void   )  const
 

Returns the state of the gripper paddles.

Returns:
0 if gripper paddles between open and closed, 1 if gripper paddles are open, 2 if gripper paddles are closed

Definition at line 302 of file ArGripper.cpp.

References GENIO, ArRobot::getAnalogPortSelected(), ArRobot::getDigIn(), GRIPPAC, ArLog::log(), NOGRIPPER, QUERYTYPE, and USERIO.

Referenced by logState(), and ArModeGripper::userTask().

long ArGripper::getMSecSinceLastPacket void   )  const
 

Gets the number of mSec since the last gripper packet.

Returns:
the number of milliseconds since the last packet

Definition at line 528 of file ArGripper.cpp.

References ArTime::mSecSince().

Referenced by logState().

int ArGripper::getPaddleState void   )  const
 

Returns the state of each gripper paddle.

Returns:
0 if no gripper paddles are triggered, 1 if the left paddle is triggered, 2 if the right paddle is triggered, 3 if both are triggered

Definition at line 268 of file ArGripper.cpp.

References GENIO, ArRobot::getAnalogPortSelected(), ArRobot::getDigIn(), GRIPPAC, ArLog::log(), NOGRIPPER, QUERYTYPE, and USERIO.

Referenced by ArModeGripper::userTask().

int ArGripper::getType void   )  const
 

Gets the type of the gripper.

Returns:
the gripper type
See also:
Type

Definition at line 510 of file ArGripper.cpp.

bool ArGripper::gripClose void   ) 
 

Closes the gripper paddles.

Returns:
whether the command was sent to the robot or not

Definition at line 77 of file ArGripper.cpp.

References ArRobot::comInt().

Referenced by ArModeGripper::userTask().

bool ArGripper::gripOpen void   ) 
 

Opens the gripper paddles.

Returns:
whether the command was sent to the robot or not

Definition at line 65 of file ArGripper.cpp.

References ArRobot::comInt().

Referenced by ArModeGripper::userTask().

bool ArGripper::gripperDeploy void   ) 
 

Puts the gripper in a deployed position, ready for use.

Returns:
whether the command was sent to the robot or not

Definition at line 149 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::gripperHalt void   ) 
 

Halts the lift and the gripper paddles.

Returns:
whether the command was sent to the robot or not

Definition at line 161 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::gripperStore void   ) 
 

Puts the gripper in a storage position.

Returns:
whether the command was sent to the robot or not

Definition at line 137 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::gripPressure int  mSecIntervals  ) 
 

Sets the amount of pressure the gripper applies.

Returns:
whether the command was sent to the robot or not

Definition at line 173 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::gripStop void   ) 
 

Stops the gripper paddles.

Returns:
whether the command was sent to the robot or not

Definition at line 89 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::isGripMoving void   )  const
 

Returns true if the gripper paddles are moving.

Returns:
true if the gripper paddles are moving

Definition at line 203 of file ArGripper.cpp.

References GENIO, ArRobot::getAnalogPortSelected(), GRIPPAC, ArLog::log(), NOGRIPPER, QUERYTYPE, and USERIO.

Referenced by logState().

bool ArGripper::isLiftMaxed void   )  const
 

Returns the state of the lift.

Returns:
false if lift is between up and down, true is either all the way up or down

Definition at line 376 of file ArGripper.cpp.

References GENIO, ArRobot::getAnalogPortSelected(), ArRobot::getDigIn(), GRIPPAC, ArLog::log(), NOGRIPPER, QUERYTYPE, and USERIO.

Referenced by logState(), and ArModeGripper::userTask().

bool ArGripper::isLiftMoving void   )  const
 

Returns true if the lift is moving.

Returns:
true if the lift is moving

Definition at line 235 of file ArGripper.cpp.

References GENIO, ArRobot::getAnalogPortSelected(), GRIPPAC, ArLog::log(), NOGRIPPER, QUERYTYPE, and USERIO.

Referenced by logState().

bool ArGripper::liftCarry int  mSecIntervals  ) 
 

Raises the lift by a given amount of time.

Returns:
whether the command was sent to the robot or not

Definition at line 188 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::liftDown void   ) 
 

Lowers the lift to the bottom.

Returns:
whether the command was sent to the robot or not

Definition at line 113 of file ArGripper.cpp.

References ArRobot::comInt().

Referenced by ArModeGripper::userTask().

bool ArGripper::liftStop void   ) 
 

Stops the lift.

Returns:
whether the command was sent to the robot or not

Definition at line 125 of file ArGripper.cpp.

References ArRobot::comInt().

bool ArGripper::liftUp void   ) 
 

Raises the lift to the top.

Returns:
whether the command was sent to the robot or not

Definition at line 101 of file ArGripper.cpp.

References ArRobot::comInt().

Referenced by ArModeGripper::userTask().

void ArGripper::setType int  type  ) 
 

Sets the type of the gripper.

Parameters:
type the type of gripper to set it to

Definition at line 518 of file ArGripper.cpp.

References ArRobot::comInt(), GRIPPAC, and QUERYTYPE.


The documentation for this class was generated from the following files:
Generated on Wed Oct 19 12:56:48 2005 for Aria by  doxygen 1.4.0