ComplexMovement.H

00001 // #ifndef __COMPLEX_MOVEMENT_H__
00002 // #define __COMPLEX_MOVEMENT_H__
00003 
00004 // #include "Globals.H"
00005 // #include "PreMotorComplex.H"
00006 // #include "ActionInput.H"
00007 
00008 // // class PreMotorComplex;
00009 
00010 
00011 // // typedef void (PreMotorComplex::*FnPtr)(const SensorInput);
00012 // // typedef void (PreMotorComplex::*Vis_FnPtr) (const VisionInput&);
00013 
00014 // class ComplexMovement {
00015 // public:
00016 
00017 //   ComplexMovement();
00018 //   ~ComplexMovement();
00019 
00020 // //   friend class PreMotorComplex;
00021 
00022 // //   ////// ADDS A ONCE/REPEAT WORLD SENSOR MOVE //////
00023 // //   void addMove(FnPtr funcPointer,  NumMoves num, const double d);
00024 // //   void addMove(FnPtr funcPointer,  NumMoves num, const Angle a);
00025 
00026 // //   ////// ADDS A ONCE/REPEAT VISION SENSOR MOVE //////
00027 // //   void addMove(Vis_FnPtr funcPointer, NumMoves num, const rutz::shared_ptr<Point3D> p);
00028 // //   void addMove(Vis_FnPtr funcPointer, NumMoves num, const rutz::shared_ptr<Angle> a);
00029 
00030 // private:
00031 
00032 
00033 
00034 // //   std::vector<FnPtr> W_onceFuncs;
00035 // //   std::vector<SensorInput> W_onceParams;
00036 
00037 // //   std::vector<FnPtr> W_reFuncs;
00038 // //   std::vector<SensorInput> W_reParams;
00039 
00040 
00041 // //   std::vector<Vis_FnPtr> Vis_onceFuncs;
00042 // //   std::vector<VisionInput> Vis_onceParams;
00043 
00044 // //   std::vector<Vis_FnPtr> Vis_reFuncs;
00045 // //   std::vector<VisionInput> Vis_reParams;
00046 
00047 //   /*enum moveType { CENTER, SWEEP, 360TURN } */
00048 
00049 //   // world/sensor moves
00050 // //   void addRepeatMove(FnPtr funcPointer, const double d, const Angle a);
00051 // //   void addOnceMove(FnPtr funcPointer, const double d, const Angle a);
00052 
00053 // //   // vision moves
00054 // //   void addRepeatMove(Vis_FnPtr funcPointer, const rutz::shared_ptr<Point3D> p, const rutz::shared_ptr<Angle> a);
00055 // //   void addOnceMove(Vis_FnPtr funcPointer, const rutz::shared_ptr<Point3D> p, const rutz::shared_ptr<Angle> a);
00056 
00057 
00058 
00059 // };
00060 
00061 
00062 
00063 
00064 // ComplexMovement::ComplexMovement() {}
00065 // ComplexMovement::~ComplexMovement() {}
00066 
00067 
00068 // // //////////////// MOVEMENT ADDING FUNCTIONS //////////////
00069 // // void ComplexMovement::addMove(FnPtr funcPointer, NumMoves num, const double d) {
00070 
00071 // //  //    if(num == ONCE)
00072 // // //       addOnceMove(funcPointer, d, Angle(-1));
00073 // // //     else if(num == REPEAT)
00074 // // //       addRepeatMove(funcPointer, d, Angle(-1));
00075 // // //     else
00076 // // //       LINFO("DID NOT ADD MOVE");
00077 
00078 // // }
00079 
00080 // // void ComplexMovement::addMove(FnPtr funcPointer, NumMoves num, const Angle a) {
00081 
00082 // // //     if(num == ONCE)
00083 // // //       addOnceMove(funcPointer, -1.0, a);
00084 // // //     else if(num == REPEAT)
00085 // // //       addRepeatMove(funcPointer, -1.0, a);
00086 // // //     else
00087 // // //       LINFO("DID NOT ADD MOVE");
00088 
00089 // // }
00090 
00091 // // void ComplexMovement::addMove(Movements move_type, Domain domain, NumMoves num, Point3D* p) {
00092 // // //  if(domain == VISION) {
00093 // // //     if(move_type == TURN) {
00094 // // //       if(num == ONCE)
00095 // // //         addOnceMove(&PreMotorComplex::vturn, p, NULL);
00096 // // //       else
00097 // // //         addRecursiveMove(&PreMotorComplex::vturn, p, NULL);
00098 // // //     }
00099 // // //     else if(move_type == DIVE) {
00100 // // //       if(num == ONCE)
00101 // // //         addOnceMove(&PreMotorComplex::vdive, p, NULL);
00102 // // //       else
00103 // // //         addRecursiveMove(&PreMotorComplex::vdive, p, NULL);
00104 // // //     }
00105 // // //     else if(move_type == FORWARD) {
00106 // // //       if(num == ONCE)
00107 // // //         addOnceMove(&PreMotorComplex::vforward, p, NULL);
00108 // // //       else
00109 // // //         addRecursiveMove(&PreMotorComplex::vforward, p, NULL);
00110 // // //     }
00111 // // //     else
00112 // // //       printf("ComplexMovement::addMove::improper data/domain for VISION MOVE\n");
00113 // // //   }
00114 // // //   else
00115 // // //     LINFO("DID NOT ADD MOVE");
00116 // // }
00117 
00118 // // void ComplexMovement::addMove(Vis_FnPtr funcPointer, NumMoves num, const rutz::shared_ptr<Angle> a) {
00119 
00120 // // //   rutz::shared_ptr<Point3D> p;
00121 // // //   if(num == ONCE)
00122 // // //     addOnceMove(funcPointer, p, a);
00123 // // //   else if(num == REPEAT)
00124 // // //     addRepeatMove(funcPointer, p, a);
00125 // // //   else
00126 // // //     LINFO("DID NOT ADD MOVE");
00127 
00128 // // }
00129 
00130 
00131 
00132 
00133 
00134 // // ///////////////// WORLD/SENSOR ADD MOVES. ACTUALLY ADDS TO LIST ///////////
00135 // // void ComplexMovement::addRepeatMove(FnPtr funcPointer, const double d, const Angle a) {
00136 
00137 // // //   W_reFuncs.push_back(NULL);
00138 // // //   W_reFuncs[W_reFuncs.size() - 1] = funcPointer;
00139 // // //   SensorInput params(d, a);
00140 // // //   W_reParams.push_back(params);
00141 
00142 // // }
00143 
00144 // // void ComplexMovement::addOnceMove(FnPtr funcPointer, const double d, const Angle a) {
00145 
00146 // // //   W_onceFuncs.push_back(NULL);
00147 // // //   W_onceFuncs[W_onceFuncs.size() - 1] = funcPointer;
00148 // // //   SensorInput params(d, a);
00149 // // //   W_onceParams.push_back(params);
00150 
00151 // // }
00152 
00153 
00154 // // ////////////////// VISION ADD MOVES. ACTUALLY ADDS TO LIST /////////////
00155 // // void ComplexMovement::addOnceMove(Vis_FnPtr funcPointer, const rutz::shared_ptr<Point3D> p, const rutz::shared_ptr<Angle> a) {
00156 // // //   Vis_onceFuncs.push_back(NULL);
00157 // // //   Vis_onceFuncs[Vis_onceFuncs.size() - 1] = funcPointer;
00158 // // //   VisionInput params(p, a);
00159 // // //   Vis_onceParams.push_back(params);
00160 
00161 // // }
00162 
00163 // // void ComplexMovement::addRepeatMove(Vis_FnPtr funcPointer, const rutz::shared_ptr<Point3D> p, const rutz::shared_ptr<Angle> a) {
00164 // // //   Vis_reFuncs.push_back(NULL);
00165 // // //   Vis_reFuncs[Vis_reFuncs.size() - 1] = funcPointer;
00166 // // //   VisionInput params(p, a);
00167 // // //   Vis_reParams.push_back(params);
00168 // // }
00169 
00170 
00171 
00172 
00173 // #endif
Generated on Sun May 8 08:04:32 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3