00001 #ifndef __PREMOTOR_COMPLEX_H__ 00002 #define __PREMOTOR_COMPLEX_H__ 00003 00004 #include "Component/ModelManager.H" 00005 00006 #include "Captain.H" 00007 //#include "ActionInput.H" 00008 #include "ComplexMovement.H" 00009 #include "AgentManagerA.H" 00010 #include "SubController.H" 00011 #include "SubmarineAgent.H" 00012 00013 #define INVALID -1.0 00014 #define XAXIS_ERROR_CONST 3; 00015 #define ANGLE_ERROR_CONST 1; 00016 #define YAXIS_ERROR_CONST 30; 00017 #define ZAXIS_ERROR_CONST 3; 00018 #define VELOCITY_CONST 5; 00019 #define DEPTH_ERROR_CONST 5; 00020 00021 class AgentManagerA; 00022 class CaptainAgent; 00023 00024 00025 class PreMotorComplex : public SubmarineAgent { 00026 00027 public: 00028 00029 PreMotorComplex(nub::soft_ref<SubController> motor, /*rutz::shared_ptr<PreFrontalCortexAgent> pfc,*/ std::string name); 00030 PreMotorComplex(std::string name); 00031 ~PreMotorComplex(); 00032 00033 inline void setCaptainAgent 00034 (rutz::shared_ptr<CaptainAgent> pfc); 00035 00036 00037 // //! starts the PreMotorComplex 00038 // void start(); 00039 // //! stops everything 00040 // inline void stop() { itsStop = true; itsInterrupt = true; } 00041 00042 00043 // inline bool getMoveDone() { return isMoveDone; } 00044 // //! stop all movements. stay at current depth and heading, using PID 00045 // inline void msgHalt() { itsInterrupt = true; LINFO("halt called"); } 00046 // //! run ComplexMovement a, if there is a ComplexMovement already running, 00047 // //! will cause interrupt and start new movement 00048 // void run(rutz::shared_ptr<ComplexMovement> a); 00049 00050 // inline void test() { LINFO("you called me"); } 00051 00052 00053 00054 // // world/sensor moves 00055 // // turn to a goal absolute angle (heading) 00056 // // NOTE: will this be in radians? 00057 // void turn(const SensorInput goal); 00058 // // move forward/reverse in reference to goal distance (meters) 00059 // // forward: positive, reverse: negative 00060 // void forward(const SensorInput goal); 00061 // // dive/surface to a goal depth in reference to goal depth (meters) 00062 // // dive: positive, surface: negative 00063 // void dive(const SensorInput goal); 00064 // // types of searches 00065 // void sweep(const SensorInput goal); 00066 00067 // void wait(const SensorInput goal); 00068 // void startWait(const SensorInput goal); 00069 00070 // // vision moves 00071 // // turn to a goal pixel angle, or turn to a goal pixel point 00072 // void vis_turn(const VisionInput& goal); 00073 // // move forward/reverse to a goal pixel point 00074 // void vis_forward(const VisionInput& goal); 00075 // // dive/surface to a goal pixel point 00076 // void vis_dive(const VisionInput& goal); 00077 // // center on a pixel point 00078 // void vis_center(const VisionInput& goal); 00079 // // lost image retract search 00080 // void vis_lost(const VisionInput& goal); 00081 00082 00083 00084 00085 private: 00086 00087 00088 // void run(); 00089 00090 00091 00092 // Angle itsHeading; 00093 // Angle itsPitch; 00094 // Angle itsRoll; 00095 // float itsTemp; 00096 // float itsInternalPressure; 00097 // float itsDepth; 00098 00099 // //possibly its position relative to the pinger; 00100 // Point3D itsAttitude; 00101 00102 // rutz::shared_ptr<ComplexMovement> itsCurrentMove; 00103 // rutz::shared_ptr<ComplexMovement> itsNextMove; 00104 00105 // nub::soft_ref<SubController> itsPrimitiveMotor; 00106 rutz::shared_ptr<CaptainAgent> itsCaptain; 00107 00108 // bool itsInterrupt; 00109 // bool itsStop; 00110 std::string itsName; 00111 // int surfaceDepth; 00112 // bool isMoveDone; 00113 }; 00114 00115 00116 // ###################################################################### 00117 inline void PreMotorComplex::setCaptainAgent 00118 (rutz::shared_ptr<CaptainAgent> pfc) 00119 { 00120 itsCaptain = pfc; 00121 } 00122 00123 #endif