INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
insgps.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Michael Moser 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDRO_INTERFACES_INSGPS_H 00012 #define HYDRO_INTERFACES_INSGPS_H 00013 00014 #include <cstdlib> 00015 #include <string> 00016 #include <memory> 00017 #include <vector> 00018 00019 #include <hydroutil/context.h> 00020 00021 00022 namespace hydrointerfaces 00023 { 00024 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 class SOEXPORT InsGps 00055 { 00056 00057 public: 00058 00060 enum Datatype { 00062 Ins, 00064 Gps, 00066 Imu 00067 }; 00068 00070 enum StatusMessageType { 00072 NoMsg, 00074 Initialising, 00076 Ok, 00078 Warning, 00080 Fault 00081 }; 00082 00084 class GenericData 00085 { 00086 public: 00087 virtual ~GenericData(){}; 00088 virtual Datatype type() const=0; 00089 StatusMessageType statusMessageType; 00090 std::string statusMessage; 00091 private: 00092 }; 00093 00095 virtual std::auto_ptr<GenericData> read() = 0; 00096 00097 // datatypes that can be encapsulated in GenericData 00099 class InsData : public GenericData { 00100 public: 00101 Datatype type() const { return Ins; } 00103 double lat; 00105 double lon; 00107 double alt; 00109 double altAMSL; 00111 double vENU[3]; 00113 double oRPY[3]; 00114 struct timeval time; 00115 }; 00116 00121 00123 enum GpsSolutionStatus{ 00125 NoFix, 00127 BadFix, 00129 TwoDFix, 00131 GoodFix 00132 }; 00134 enum GpsCorrectionMethod{ 00136 NoDiff, 00138 CodeDiff, 00140 CarrierDiff 00141 }; 00143 enum GpsCorrectionSource{ 00145 Local, 00147 Distant, 00149 Satellite 00150 }; 00152 00154 class GpsData : public GenericData { 00155 public: 00156 Datatype type() const { return Gps; } 00158 double lat; 00160 double sigmaLat; 00162 double lon; 00164 double sigmaLon; 00166 double alt; 00168 double altAMSL; 00170 double sigmaAlt; 00171 00174 double heading; 00175 double speed; 00176 double climbRate; 00177 std::vector<double > latency; 00178 00179 00181 int sat; 00183 int obsL1; 00185 int obsL2; 00186 00188 enum GpsSolutionStatus gpsSolutionStatus; 00189 00191 enum GpsCorrectionMethod gpsCorrectionMethod; 00192 00194 std::vector<enum GpsCorrectionSource> gpsCorrectionSource; 00195 00197 std::vector<double> gpsCorrectionAge; 00198 00200 std::string gpsBaseStationId; 00201 00202 struct timeval time; 00203 }; 00204 00206 class ImuData : public GenericData { 00207 public: 00208 Datatype type() const { return Imu; } 00210 double acc[3]; 00212 double turnRate[3]; 00214 bool biasCorrected; 00216 std::vector<double> tempr; 00217 struct timeval time; 00218 }; 00219 00221 class Config 00222 { 00223 public: 00224 Config(); 00225 bool isValid() const; 00226 std::string toString() const; 00227 //bool operator==( const Config & other ); 00228 //bool operator!=( const Config & other ); 00229 }; 00230 00231 virtual ~InsGps() {}; 00232 00233 private: 00234 00235 }; 00236 00238 class SOEXPORT InsGpsFactory { 00239 public: 00240 virtual ~InsGpsFactory() {}; 00242 virtual InsGps *createDriver( const InsGps::Config &config, 00243 const hydroutil::Context &context ) const=0; 00244 }; 00245 00247 } // namespace 00248 00249 // Function for dynamically instantiating drivers. 00250 // A driver must have a function like so: 00251 // extern "C" { 00252 // hydrointerfaces::InsGpsFactory *InsGpsFactory(); 00253 // } 00254 typedef hydrointerfaces::InsGpsFactory *InsGpsDriverFactoryMakerFunc(); 00255 00256 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)