00001 // ---------------------------------------------------------------------------- 00002 // 00003 // $Id$ 00004 // 00005 // Copyright 2008, 2009, 2010, 2011, 2012 Antonio Franchi and Paolo Stegagno 00006 // 00007 // This file is part of MIP. 00008 // 00009 // MIP is free software: you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation, either version 3 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // MIP is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>. 00021 // 00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it 00023 // 00024 // ---------------------------------------------------------------------------- 00025 00026 00031 00032 00036 00037 00038 00039 #ifndef __LAS_NAV_TASK_H_ 00040 #define __LAS_NAV_TASK_H_ 00041 00042 #include <Task.h> 00043 #include <Resource.h> 00044 #include <MobileRob.h> 00045 #include <LaserNavigation.h> 00046 #include <SharedMem.h> 00047 00048 using namespace MipResources; 00049 00050 00051 namespace MipTasks{ 00052 00054 /* @{ */ 00055 00059 class LaserNavigationSharedMem : public SharedMem{ 00060 public: 00062 void initSharedMem(); 00063 00065 bool doAutoNavigation(); 00066 }; 00067 00071 class LaserNavigationTaskOptions : public Options { 00072 public: 00073 00075 DecimalOption *multVel; 00076 00077 LaserNavigationTaskOptions(); 00078 00079 OptionGroupsType getGroup(); 00080 string getObjectName() const { 00081 return "LaserNavigationTaskOptions"; 00082 } 00083 }; 00084 00088 class LaserNavigationTask : public Task{ 00089 private: 00090 static const TaskPlate _plate = LNV_TASK; 00091 static const long int _maxDurSec = 0, _maxDurUsec = 30000; 00092 static const long int _maxSamplPeriodSec = 0, _maxSamplPeriodUsec = 100000; 00093 static const long int _minSamplPeriodSec = 0, _minSamplPeriodUsec = 50000; 00094 00095 LaserNavigation *_navigator; 00096 00097 MobileRob* _mobileRob; 00098 LaserNavigationSharedMem* _sharedMem; 00099 00100 Scan currScan; 00101 00102 LaserNavigationTaskOptions* _options; 00103 Decimal _multVelCmd; 00104 00105 public: 00107 LaserNavigationTask(ResourcePointers resources,int argc, const char* argv[]); 00108 00110 ~LaserNavigationTask(); 00111 00113 TaskPlate getPlate() const { return _plate; } 00114 00116 Time getMaxDuration(){ return Time(_maxDurSec,_maxDurUsec); } 00117 00119 Time getMaxSamplPeriod(){ return Time(_maxSamplPeriodSec,_maxSamplPeriodUsec); } 00120 00122 Time getMinSamplPeriod(){ return Time(_minSamplPeriodSec,_minSamplPeriodUsec); } 00123 00125 TaskOutputs run(); 00126 }; 00127 00128 /* @} */ 00129 00130 };// end namespace MipTasks 00131 00132 #endif 00133 00134 00135 00136 00137