Pioneer Module Mobile manual Momentary switch, 0 is pressed

Page 26

/* gripper control bits (DIGOUTPUT) */

#define sfGRIPSTATEMASK 0x05 /* picks out state bits in DIGOUTPUT */ #define sfGRIPMOTORBIT 0x02 /* motor bit, 0 is off, 1 is on */

#define sfGRIPDIRBIT 0x01

/* direction bit, 0 is down, 1 is up */

#define sfSPEAKERBIT

 

0x04

 

#define sfRIGHTLEDBIT

 

0x08

/* 0 is off, 1 is on */

#define sfLEFTLEDBIT

0x10

 

/* gripper sense bits (DIGINPUT) */

#define sfGRIPTOPBIT

 

0x01

/* top limit, 0 if hit */

#define sfGRIPMIDBIT

0x02

/* mid-level, 0 if hit */

#define sfGRIPBOTBIT

 

0x04

/* bottom limit, 0 if hit */

#define sfGRIPINIRBIT

0x08

/* inner IR, 0 is beam break */

#define sfGRIPOUTIRBIT

0x10

/* outer IR */

#define sfGRIPBUMPBIT

0x20

/* gripper bumpers, 0 is bump */

#define sfGRIPMOMBIT

 

0x40

/* momentary switch, 0 is pressed */

#define sfGRIPSPSTBIT

 

0x80

/* SPST switch, 0 is up */

int

/* returns the robot gripper state setpoint */

sfGripperGetState(void)

{

if (flakey.digoutput & sfGRIPMOTORBIT) return sfMOVING;

else

return flakey.digoutput & sfGRIPSTATEMASK;

}

 

void

/* sets robot gripper state setpoint */

sfGripperSetState(int state)

{

sfRobotComInt(sfCOMGRIPPER, state & sfGRIPSTATEMASK);

}

void/* sfLEFT, sfRIGHT, sfON, sfOFF */ sfGripperSetLed(int which, int state)

{

switch(which)

{

case sfLEFT:

which = sfLEFTLEDBIT;

break;

(continued)

22

Image 26
Contents Gripper Experimenter’s Module Manual Gripper & Experimenter’s Module Contents Maintenance & Repair Package Components IntroductionGripper and Experimenter’s Package User Supplied ComponentsGripper Description Basic Pioneer PlatformGripper & Experimenter’s Module Pioneer Gripper side view Experimenter’s Module Description Pioneer 1 Experimenter’s ModulePioneer and Saphira Newsgroups Additional ResourcesPioneer Web Software Archive Support Pioneer-support@rwii.comRemove Microcontroller from Console InstallationRemove the Console Installation ReplaceConnect Cables Reattach Microcontroller to ConsoleRemove Nose Attach Gripper/Experimenter’s Module to PioneerRe-Attach the Console Test the AssemblyRe-Attach the Console Cables Psos Server Information Packet Gripper Operation and ProgrammingGripper Self Test Direct Control via Digital Ports Gripper I/OGripper Programming SfRobotCom2BytessfCOMDIGOUT, 0x2 SfRobotCom2BytessfCOMDIGOUT, 0x20SfRobotCom2BytessfCOMDIGOUT, 0x3 Int sfGripperGetState voidGripper functions Experimenter’s Module I/O PortsExperimenter’s Module Digin BREAK, Boot to r EturnDigin Self-Test To skip Vv.vVProgramming the Speaker Programming the Digital I/O PortsProgramming the A/D Ports Drive Lubrication Maintenance & RepairGripper Belt Adjustments Factory RepairsAppendix a Example C Program Demonstrates Gripper and Speaker FunctionsGripper & Experimenter’s Module Momentary switch, 0 is pressed Gripper & Experimenter’s Module Appendix B Pioneer Server Information PacketIndex ComsayMore, Grinnell Gripper & Experimenter’s Module Warranty & Liabilities