ClearingTask.h
Go to the documentation of this file.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
00029
00030
00035
00036
00037
00038 #ifndef __CLEARING_TASK_H_
00039 #define __CLEARING_TASK_H_
00040
00041
00042 #include <Task.h>
00043 #include <Resource.h>
00044 #include <MobileRob.h>
00045 #include <DraWin.h>
00046 #include <SharedMem.h>
00047 #include <Time.h>
00048
00049 #include <CommonOptions.h>
00050 #include "ClearingMobileRobot.h"
00051 #include <MultiReg.h>
00052 #include <DAEKF.h>
00053 #include <PaFil.h>
00054 #include <CommModule.h>
00055
00056
00057 using namespace MipAlgorithms;
00058 using namespace MipResources;
00059
00060 namespace MipTasks{
00061
00063
00064
00065
00069 class ClearingOptions : public Options {
00070 public:
00071
00072 IntOption* filterType;
00073
00074 ClearingOptions();
00075
00076 OptionGroupsType getGroup();
00077
00078 string getObjectName() const {
00079 return "ClearingOptions";
00080 }
00081 };
00082
00083
00087 class ClearingSharedMem : public SharedMem{
00088 public:
00090 void initSharedMem();
00091
00095 PosiFeatures getMyProtrusions(MotionModuleTState &state);
00096
00099 void setFormation(PoseFeatures &form);
00100
00103 void setEstimates(PoseFeatures &est);
00104
00107 Pose getTarget();
00108
00111 void setTarget(Pose &t);
00112
00115 bool doMloc();
00116
00119 bool doAutoNavigation();
00120
00123 bool printFormation();
00124
00127 bool printFormationDetails();
00128
00131 vector<int> getAvoidClearingIds();
00132 };
00133
00134
00138 class ClearingTask : public Task{
00139 private:
00140 static const TaskPlate _plate = CLE_TASK;
00141 static const long int _maxDurSec = 0, _maxDurUsec = 500000;
00142 static const long int _maxSamplPeriodSec = 1, _maxSamplPeriodUsec = 0;
00143 static const long int _minSamplPeriodSec = 0, _minSamplPeriodUsec = 400000;
00144
00145 MobileRob* _mobileRob;
00146 ClearingMobileRobot* _clMr;
00147 Position robPosition;
00148 Pose robPose;
00149
00150 DraWin* _draWin;
00151 unsigned int _drawList;
00152 bool dwOn;
00153
00154 ClearingSharedMem* _sharedMem;
00155
00156 CommModule* _commModule;
00157
00158 vector<ClearingAgent> agentVec;
00159 vector<Position> agentViewpoints;
00160 Grid* gGlobalGrid;
00161 bool bContinue;
00162
00163 bool domultireg;
00164 bool dofilter;
00165
00166 map<int,PosiFeatures> othersPosiFeatures;
00167 map<int,Pose> othersPose;
00168 vector<int> othersPosiFeaturesNums;
00169 vector<int> othersPoseNums;
00170
00171 int myId;
00172 Pose myPose;
00173 PosiFeatures myPosiFeatures;
00174 Observation myObservation;
00175
00176 ClearingOptions options;
00177
00178 public:
00180 ClearingTask(ResourcePointers resources,int argc, const char* argv[]);
00181
00183 ~ClearingTask();
00184
00187 TaskPlate getPlate() const {
00188 return _plate;
00189 }
00192 Time getMaxDuration(){
00193 return Time(_maxDurSec,_maxDurUsec);
00194 }
00197 Time getMaxSamplPeriod(){
00198 return Time(_maxSamplPeriodSec,_maxSamplPeriodUsec);
00199 }
00202 Time getMinSamplPeriod(){
00203 return Time(_minSamplPeriodSec,_minSamplPeriodUsec);
00204 }
00207 TaskOutputs run();
00208
00209 private:
00210
00212 void comunicate();
00213
00214 };
00215
00216
00217
00218 };
00219
00220
00221 #endif
00222
00223
00224
00225
00226