orca-robotics


INTRODUCTION
Overview
Download and Install
Documentation

REPOSITORY
Interfaces
Drivers
Libraries
Utilities
Software Map

DEVELOPER
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

insgps.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 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         Ok,
00076         Warning,
00078         Fault
00079     };
00080 
00082     class GenericData
00083     {
00084         public:
00085             virtual ~GenericData(){};
00086             virtual Datatype type() const=0;
00087             StatusMessagetype statusMessageType;
00088             std::string statusMessage;
00089         private:
00090     };
00091 
00093     virtual std::auto_ptr<GenericData> read() = 0;
00094 
00095     // datatypes that can be encapsulated in GenericData
00097     class InsData : public GenericData {
00098     public:
00099         Datatype type() const { return Ins; }
00101         double lat;
00103         double lon;
00105         double alt;
00107         double altAMSL;
00109         double vENU[3];
00111         double oRPY[3];
00112         struct timeval time;
00113     };
00114 
00120     enum GpsSolutionStatus{
00122         NoFix,
00124         BadFix,
00126         Good
00127     };
00129     enum GpsCorrectionMethod{
00131         None,
00133         PhaseDiff,
00135         CarrierDiff
00136     };
00138     enum GpsCorrectionSource{
00140         Local,
00142         Distant,
00144         Satellite
00145     };
00147 
00149     class GpsData : public GenericData {
00150     public:
00151         Datatype type() const { return Gps; }
00153         double lat;
00155         double lon;
00157         double alt;
00159         double altAMSL;
00161         double hDop;
00163         double vDop;
00164 
00165         double heading;
00166         double speed;
00167         double climbRate;
00168 
00170         int sat;
00172         int obsL1;
00174         int obsL2;
00175 
00177         enum GpsSolutionStatus gpsSolutionStatus;
00178 
00180         enum GpsCorrectionMethod gpsCorrectionMethod;
00181 
00183         std::vector<enum GpsCorrectionSource> gpsCorrectionSource;
00184 
00185         struct timeval time;
00186     };
00187 
00189     class ImuData : public GenericData {
00190     public:
00191         Datatype type() const { return Imu; }
00193         double acc[3];
00195         double turnRate[3];
00197         bool biasCorrected;
00199         std::vector<double> tempr;
00200         struct timeval time;
00201     };
00202 
00204     class Config
00205     {
00206     public:
00207         Config();
00208         bool isValid() const;
00209         std::string toString() const;
00210         //bool operator==( const Config & other );
00211         //bool operator!=( const Config & other );
00212     };
00213 
00214     virtual ~InsGps() {};
00215 
00216 private:
00217 
00218 };
00219 
00221 class SOEXPORT InsGpsFactory {
00222 public:
00223     virtual ~InsGpsFactory() {};
00225     virtual InsGps *createDriver( const InsGps::Config &config,
00226                                   const hydroutil::Context &context ) const=0;
00227 };
00228 
00230 } // namespace
00231 
00232 // Function for dynamically instantiating drivers.
00233 // A driver must have a function like so:
00234 // extern "C" {
00235 //     hydrointerfaces::InsGpsFactory *InsGpsFactory();
00236 // }
00237 typedef hydrointerfaces::InsGpsFactory *DriverFactoryMakerFunc();
00238 
00239 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5