Aria  2.8.0
ArGripper Class Reference

Provides an interface to the Pioneer gripper device. More...

#include <ArGripper.h>

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. More...
 
void connectHandler (void)
 The handler for when the robot connects.
 
int getBreakBeamState (void) const
 Returns the state of the gripper's breakbeams. More...
 
int getGraspTime (void) const
 Gets the grasp time. More...
 
int getGripState (void) const
 Returns the state of the gripper paddles. More...
 
long getMSecSinceLastPacket (void) const
 Gets the number of mSec since the last gripper packet. More...
 
int getPaddleState (void) const
 Returns the state of each gripper paddle. More...
 
int getType (void) const
 Gets the type of the gripper. More...
 
bool gripClose (void)
 Closes the gripper paddles. More...
 
bool gripOpen (void)
 Opens the gripper paddles. More...
 
bool gripperDeploy (void)
 Puts the gripper in a deployed position, ready for use. More...
 
bool gripperHalt (void)
 Halts the lift and the gripper paddles. More...
 
bool gripperStore (void)
 Puts the gripper in a storage position. More...
 
bool gripPressure (int mSecIntervals)
 Sets the amount of pressure the gripper applies. More...
 
bool gripStop (void)
 Stops the gripper paddles. More...
 
bool isGripMoving (void) const
 Returns true if the gripper paddles are moving. More...
 
bool isLiftMaxed (void) const
 Returns the state of the lift. More...
 
bool isLiftMoving (void) const
 Returns true if the lift is moving. More...
 
bool liftCarry (int mSecIntervals)
 Raises the lift by a given amount of time. More...
 
bool liftDown (void)
 Lowers the lift to the bottom. More...
 
bool liftStop (void)
 Stops the lift. More...
 
bool liftUp (void)
 Raises the lift to the top. More...
 
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. More...
 
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

Provides an interface to the Pioneer gripper device.

Examples:
gripperExample.cpp.

Member Enumeration Documentation

◆ Type

These are the types for the gripper.

Enumerator
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.

Constructor & Destructor Documentation

◆ ArGripper()

ArGripper::ArGripper ( ArRobot robot,
int  gripperType = QUERYTYPE 
)

Constructor.

Parameters
robotThe robot this gripper is attached to
gripperTypeHow to communicate with the gripper: see ArGripper::Type. The default, QUERYTYPE, will work with most robot configurations with a recent firmware version.

Member Function Documentation

◆ getBreakBeamState()

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

◆ getGraspTime()

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

◆ getGripState()

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

◆ getMSecSinceLastPacket()

long ArGripper::getMSecSinceLastPacket ( void  ) const

Gets the number of mSec since the last gripper packet.

Returns
the number of milliseconds since the last packet

◆ getPaddleState()

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

◆ getType()

int ArGripper::getType ( void  ) const

Gets the type of the gripper.

Returns
the gripper type
See also
Type
Examples:
gripperExample.cpp.

◆ gripClose()

bool ArGripper::gripClose ( void  )

Closes the gripper paddles.

Returns
whether the command was sent to the robot or not
Examples:
gripperExample.cpp.

◆ gripOpen()

bool ArGripper::gripOpen ( void  )

Opens the gripper paddles.

Returns
whether the command was sent to the robot or not
Examples:
gripperExample.cpp.

◆ gripperDeploy()

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

◆ gripperHalt()

bool ArGripper::gripperHalt ( void  )

Halts the lift and the gripper paddles.

Returns
whether the command was sent to the robot or not
Examples:
gripperExample.cpp.

◆ gripperStore()

bool ArGripper::gripperStore ( void  )

Puts the gripper in a storage position.

Returns
whether the command was sent to the robot or not

◆ gripPressure()

bool ArGripper::gripPressure ( int  mSecIntervals)

Sets the amount of pressure the gripper applies.

Returns
whether the command was sent to the robot or not

◆ gripStop()

bool ArGripper::gripStop ( void  )

Stops the gripper paddles.

Returns
whether the command was sent to the robot or not

◆ isGripMoving()

bool ArGripper::isGripMoving ( void  ) const

Returns true if the gripper paddles are moving.

Returns
true if the gripper paddles are moving

◆ isLiftMaxed()

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

◆ isLiftMoving()

bool ArGripper::isLiftMoving ( void  ) const

Returns true if the lift is moving.

Returns
true if the lift is moving

◆ liftCarry()

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

◆ liftDown()

bool ArGripper::liftDown ( void  )

Lowers the lift to the bottom.

Returns
whether the command was sent to the robot or not
Examples:
gripperExample.cpp.

◆ liftStop()

bool ArGripper::liftStop ( void  )

Stops the lift.

Returns
whether the command was sent to the robot or not

◆ liftUp()

bool ArGripper::liftUp ( void  )

Raises the lift to the top.

Returns
whether the command was sent to the robot or not
Examples:
gripperExample.cpp.

◆ setType()

void ArGripper::setType ( int  type)

Sets the type of the gripper.

Parameters
typethe type of gripper to set it to

The documentation for this class was generated from the following files: