00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029 #ifndef _DBASE_GRASP_H_
00030 #define _DBASE_GRASP_H_
00031
00032 #include "stdio.h"
00033 #include "qobject.h"
00034 #include <fstream>
00035
00036 #include "scanSimulator.h"
00037
00038 class IVmgr;
00039 class EGPlanner;
00040 class Hand;
00041 class Body;
00042 class GraspableBody;
00043 class GraspItGUI;
00044 class GraspPlanningState;
00045 class SoSensor;
00046 class SoTimerSensor;
00047
00048 class DBaseBatchPlanner : public QObject
00049 {
00050 Q_OBJECT
00051 private:
00052
00053
00054
00055
00056
00057 enum Type{DEXTEROUS=0, GRIPPER=1};
00058
00059 Type mType;
00060 GraspableBody *mObject;
00061 Hand *mHand;
00062 IVmgr *ivmgr;
00063 GraspItGUI *mGui;
00064 EGPlanner *mPlanner;
00065
00066 FILE *mResultFile;
00067
00068 std::fstream mLogStream;
00069 char *mScanDirectory;
00070 double mMaxTime;
00071 void usage();
00072 void processSolution(const GraspPlanningState *sol);
00073 void writeContactsToFile(Hand *hand, Body *object);
00074 void takeScans();
00075 static void sensorCB(void *data,SoSensor*);
00076 SoTimerSensor *mTimerSensor;
00077 int numOfGrasps;
00078 int numOfGraspsGoal;
00079 double energyConstraint;
00080
00081 void writeCloudToFile( int i, int j, const std::vector<position> &cloud);
00082 void writeRawToFile( int i, int j, const std::vector<RawScanPoint> &rawData,
00083 vec3 loc, vec3 dir, vec3 up);
00084 void writeSolutionsToFile(FILE *f);
00085
00086
00087 public slots:
00088
00089 void plannerUpdate();
00090
00091 void plannerComplete();
00092 public:
00093 DBaseBatchPlanner(IVmgr *mgr, GraspItGUI *gui);
00094 ~DBaseBatchPlanner();
00095 bool processArguments(int argc, char **argv);
00096 bool startPlanner();
00097 };
00098
00099 #endif