HandEyeGripper.h
Go to the documentation of this file.00001 #ifndef INCLUDED_HandEyeGripper_h
00002 #define INCLUDED_HandEyeGripper_h
00003
00004 #include <math.h>
00005
00006 #include "Shared/WorldState.h"
00007
00008 class HandEyeGripper {
00009 public:
00010 void OpenClose(int OriJoint, float gripperValue, float *gripperServo) {
00011 #ifdef TGT_HAS_ARMS
00012 float negscale = -1;
00013 float posscale = -1;
00014 unsigned int fingerOffset = 1;
00015 #ifdef TGT_HANDEYEZ
00016 negscale = -0.5f;
00017 posscale = -0.5f;
00018 #endif
00019
00020 for(unsigned int counter = ArmOffset + OriJoint + fingerOffset; counter < ArmOffset + NumArmJoints; counter++) {
00021 if (gripperValue < 0) {
00022 gripperServo[counter] = (gripperValue+1)/2 * negscale;
00023 }
00024 else {
00025 gripperServo[counter] = (gripperValue+1)/2 * posscale;
00026 }
00027 }
00028 #endif
00029 }
00030 };
00031
00032 #endif