00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2010 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, 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 00029 #ifndef CROVIO_H 00030 #define CROVIO_H 00031 00032 #include <mrpt/core.h> 00033 #include <mrpt/utils/utils_defs.h> 00034 #include <mrpt/hwdrivers/link_pragmas.h> 00035 #include <mrpt/synch/CCriticalSection.h> 00036 #include <mrpt/synch/CThreadSafeVariable.h> 00037 #include <mrpt/slam/CObservationImage.h> 00038 00039 namespace mrpt 00040 { 00041 namespace hwdrivers 00042 { 00043 using namespace std; 00044 00045 class HWDLLIMPEXP CRovio 00046 { 00047 private: 00048 mrpt::synch::CThreadSafeVariable<bool> newFrame; 00049 mrpt::synch::CThreadSafeVariable<bool> camerathread; 00050 mrpt::system::TThreadHandle cam_hd; 00051 mrpt::slam::CObservationImagePtr buffer_img; 00052 mrpt::synch::CCriticalSection buffer_img_cs; 00053 mrpt::math::CMatrix intrinsic_matrix; 00054 std::vector<double> distortion; 00055 00056 public: 00057 //bool camerathread; 00058 struct TParam 00059 { 00060 string IP; 00061 string user; 00062 string password; 00063 } TOptions; 00064 string response, errormsg; 00065 00066 CRovio(); 00067 virtual ~CRovio(); 00068 void Initialize(string &errormsg_out, string url_out="150.214.109.134", string user_out="admin", string password_out="admin"); 00069 void Moving(int, int, int, string &, string &); 00070 static void StartCamera(void* ref); 00071 static void StartCamera2(void* ref); 00072 void getLastImage(mrpt::slam::CObservationImagePtr& lastImage ); 00073 void getLastImage2(mrpt::slam::CObservationImagePtr& lastImage ); 00074 void captureImage(mrpt::utils::CImage & picture); 00075 void loadCameraParam(); 00076 void captureImageRect(mrpt::utils::CImage & picture); 00077 int* getEncoders(); 00078 mrpt::math::TPose2D getPosition(); 00079 00080 }; // End of class 00081 00082 } // End of namespace 00083 00084 } // End of namespace 00085 00086 #endif
| Page generated by Doxygen 1.6.2 for MRPT 0.8.1 SVN:exported at Mon Feb 15 22:01:07 UTC 2010 |
