00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #include "pincer.h"
00031 #include "world.h"
00032 #include "grasp.h"
00033
00040 void
00041 Pincer::DOFController(double timeStep)
00042 {
00043 int d,c,j,l;
00044 Link *prevLink,*nextLink;
00045 position jointPos;
00046 vec3 jointAxis;
00047 transf jointTran;
00048 bool dofDone[numDOF];
00049 int numContacts;
00050
00051 #ifdef GRASPITDBG
00052 std::cout << " in pincer controller"<<std::endl;
00053 #endif
00054 Robot::DOFController(timeStep);
00055
00056
00057
00058 grasp->CollectContacts();
00059 numContacts = grasp->getNumContacts();
00060
00061 if (numContacts > 0) {
00062 grasp->setGripForce(20.0);
00063 grasp->BuildGraspMap();
00064 grasp->BuildJacobian();
00065
00066 if (grasp->FindGripAxis()==SUCCESS) {
00067 for (d=0;d<numDOF;d++) {
00068 #ifdef GRASPITDBG
00069 printf("setting dof effort %d to: %lf\n",d,grasp->getOptDOFEfforts()[d]);
00070 #endif
00071 dofVec[d]->SetForce(1.0e+9*grasp->getOptDOFEfforts()[d]);
00072 }
00073 }
00074 }
00075
00076 }