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 CSickLaserUSB_H 00029 #define CSickLaserUSB_H 00030 00031 #include <mrpt/hwdrivers/C2DRangeFinderAbstract.h> 00032 #include <mrpt/hwdrivers/CInterfaceFTDI.h> 00033 00034 namespace mrpt 00035 { 00036 namespace hwdrivers 00037 { 00062 class HWDLLIMPEXP CSickLaserUSB : public C2DRangeFinderAbstract 00063 { 00064 DEFINE_GENERIC_SENSOR(CSickLaserUSB) 00065 00066 private: 00067 CInterfaceFTDI *m_usbConnection; 00068 std::string m_serialNumber; 00069 std::string m_sensorLabel; 00070 00071 uint32_t m_timeStartUI; 00072 mrpt::system::TTimeStamp m_timeStartTT; 00073 00076 poses::CPose3D m_sensorPose; 00077 00078 static int CRC16_GEN_POL; 00079 00080 00081 bool checkControllerIsConnected(); 00082 bool waitContinuousSampleFrame( vector_float &ranges, unsigned char &LMS_status, uint32_t &out_board_timestamp, bool &is_mm_mode ); 00083 uint16_t computeCRC(unsigned char *data, unsigned long len); 00084 00085 public: 00088 CSickLaserUSB(); 00089 00092 virtual ~CSickLaserUSB(); 00093 00096 void setDeviceSerialNumber(const std::string &deviceSerialNumber) 00097 { 00098 m_serialNumber = deviceSerialNumber; 00099 } 00100 00104 void doProcessSimple( 00105 bool &outThereIsObservation, 00106 mrpt::slam::CObservation2DRangeScan &outObservation, 00107 bool &hardwareError ); 00108 00112 void loadConfig( 00113 const mrpt::utils::CConfigFileBase &configSource, 00114 const std::string &iniSection ); 00115 00119 bool turnOn(); 00120 00124 bool turnOff(); 00125 00126 }; // End of class 00127 00128 } // End of namespace 00129 } // End of namespace 00130 00131 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Sun Aug 9 21:47:23 CEST 2009 |