Gripper & Experimenter’s Module
The revised PSOS 4.2 (and later) sfCOMDIGOUT command has a
The Saphira function, sfRobotCom2Bytes, packages the sfCOMDIGOUT command and values for you. For example:
sfRobotCom2Bytes(sfCOMDIGOUT, 0x20, 0x00)
resets bit 5 (OD0=0), and leaves everything else alone.
Accordingly, make the Gripper go up:
sfRobotCom2Bytes(sfCOMDIGOUT, 0x3, 0x3)
Go down:
sfRobotCom2Bytes(sfCOMDIGOUT, 0x3, 0x2)
And stop:
sfRobotCom2Bytes(sfCOMDIGOUT, 0x2, 0x00)
You have to monitor the various Gripper state switches to determine if and when it achieves a particular
4.4.2 State Commands
A more intelligent means of controlling the Gripper is through PSOS sfCOMGRIPPER command and state parameters. These automatically manage the Gripper so to achieve some
To operate the Gripper this way, you simply issue a state command to the robot. You don’t need to, but you may monitor the Gripper’s progress towards the state via bits 0 and 2 of the digout part of the server information packet (“sfROBOT.digoutput”). During transitions, the state returned by the robot is set to sfGRIPMOVING. After successfully achieving a state, the state returned is that state. If there is a
The various states and values are included in the script at the end of this chapter and that you may including in your own C programs.
There also are several Saphira convenience functions defined for gripper states:
int sfGripperGetState (void)
Returns the robot gripper state setpoint
void sfGripperSetState (int state)
Sets the robot gripper state setpoint
13