00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2008 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 namespace mrpt 00041 { 00042 namespace hwdrivers 00043 { 00044 using namespace mrpt::utils; 00045 00053 class HWDLLIMPEXP C2DRangeFinderAbstract : public mrpt::utils::CDebugOutputCapable, public CGenericSensor 00054 { 00055 private: 00056 mrpt::slam::CObservation2DRangeScan m_lastObservation; 00057 bool m_lastObservationIsNew; 00058 bool m_hardwareError; 00059 00062 synch::CCriticalSection m_csChangeStream,m_csLastObservation; 00063 00064 mrpt::slam::CObservation2DRangeScanPtr m_nextObservation; 00065 00066 protected: 00069 utils::CStream *m_stream; 00070 00071 public: 00072 00075 C2DRangeFinderAbstract(); 00076 00079 virtual ~C2DRangeFinderAbstract(); 00080 00085 void bindIO( CStream *streamIO ); 00086 00089 void getObservation( 00090 bool &outThereIsObservation, 00091 mrpt::slam::CObservation2DRangeScan &outObservation, 00092 bool &hardwareError ); 00093 00096 void doProcess(); 00097 00101 virtual void doProcessSimple( 00102 bool &outThereIsObservation, 00103 mrpt::slam::CObservation2DRangeScan &outObservation, 00104 bool &hardwareError ) = 0; 00105 00109 virtual bool turnOn() = 0; 00110 00114 virtual bool turnOff() = 0; 00115 00116 00117 }; // End of class 00118 } // End of namespace 00119 } // End of namespace 00120 00121 00122 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |