00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 University of Malaga | 00007 | | 00008 | This software was written by the Perception and Robotics | 00009 | research group, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef C2DRangeFinderAbstract_H 00029 #define C2DRangeFinderAbstract_H 00030 00031 #include <mrpt/utils/CStream.h> 00032 #include <mrpt/synch.h> 00033 #include <mrpt/utils/CDebugOutputCapable.h> 00034 #include <mrpt/slam/CObservation2DRangeScan.h> 00035 #include <mrpt/utils/CConfigFileBase.h> 00036 00037 #include <mrpt/hwdrivers/link_pragmas.h> 00038 #include <mrpt/hwdrivers/CGenericSensor.h> 00039 00040 #include <mrpt/math/CPolygon.h> 00041 00042 namespace mrpt 00043 { 00044 namespace hwdrivers 00045 { 00046 using namespace mrpt::utils; 00047 00059 class HWDLLIMPEXP C2DRangeFinderAbstract : public mrpt::utils::CDebugOutputCapable, public CGenericSensor 00060 { 00061 private: 00062 mrpt::slam::CObservation2DRangeScan m_lastObservation; 00063 bool m_lastObservationIsNew; 00064 bool m_hardwareError; 00065 00068 synch::CCriticalSection m_csChangeStream,m_csLastObservation; 00069 00070 mrpt::slam::CObservation2DRangeScanPtr m_nextObservation; 00071 00072 std::vector<mrpt::math::CPolygon> m_lstExclusionPolys; 00073 00074 protected: 00077 utils::CStream *m_stream; 00078 00087 void loadExclusionAreas( 00088 const mrpt::utils::CConfigFileBase &configSource, 00089 const std::string &iniSection ); 00090 00094 void filterByExclusionAreas( mrpt::slam::CObservation2DRangeScan &obs) const; 00095 00096 00097 public: 00098 00101 C2DRangeFinderAbstract(); 00102 00105 virtual ~C2DRangeFinderAbstract(); 00106 00111 void bindIO( CStream *streamIO ); 00112 00115 void getObservation( 00116 bool &outThereIsObservation, 00117 mrpt::slam::CObservation2DRangeScan &outObservation, 00118 bool &hardwareError ); 00119 00122 void doProcess(); 00123 00127 virtual void doProcessSimple( 00128 bool &outThereIsObservation, 00129 mrpt::slam::CObservation2DRangeScan &outObservation, 00130 bool &hardwareError ) = 0; 00131 00135 virtual bool turnOn() = 0; 00136 00140 virtual bool turnOff() = 0; 00141 00142 00143 }; // End of class 00144 } // End of namespace 00145 } // End of namespace 00146 00147 00148 #endif
Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN:exported at Thu May 21 04:14:55 UTC 2009 |