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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

hydrodrivers/hydroinsgpsnovatelspan/driver.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 Matthew Ridley, Ben Upcroft, 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_INSGPS_NOVATELSPAN_H
00012 #define HYDRO_INSGPS_NOVATELSPAN_H
00013 
00014 #include <memory>
00015 
00016 #include <hydroutil/context.h>
00017 #include <hydrointerfaces/insgps.h>
00018 
00019 // forward declarations
00020 //
00021 // avoid exposing the novatel gear to the world
00022 namespace hydronovatelutil{
00023     struct BESTGPSPOS_LOG ;
00024     struct BESTGPSVEL_LOG ;
00025     struct INSPVASB_LOG ;
00026     struct RAWIMUSB_LOG ;
00027 }
00028 // users don't need to know about serial devices
00029 namespace gbxserialacfr{
00030     class Serial;
00031 }
00032 
00033 namespace insgpsnovatelspan{
00034 
00035 /*
00036 @brief class which handles interactions with the
00037        Novatel Span InsGps navigation sensors
00038 
00039 @author Matthew Ridley, Ben Upcroft, Michael Moser
00040  */
00041 union novatel_message;
00042 class Driver : public hydrointerfaces::InsGps
00043 {
00044 public:
00045 
00046     Driver( const Config &cfg, const hydroutil::Context &context );
00047     virtual ~Driver();
00048 
00049     // from InsGps
00050     virtual std::auto_ptr<hydrointerfaces::InsGps::GenericData> read();
00051 
00052 private:
00053 
00055     int connectToHardware();
00057     void configureImu();
00059     void configureGps();
00061     void requestData();
00065     int readNovatelMessage( union novatel_message &msg );
00068     std::auto_ptr<hydrointerfaces::InsGps::GenericData> novatel2Hydro(hydronovatelutil::INSPVASB_LOG &insPva);
00069     std::auto_ptr<hydrointerfaces::InsGps::GenericData> novatel2Hydro(hydronovatelutil::BESTGPSPOS_LOG &bestGpsPos, hydronovatelutil::BESTGPSVEL_LOG &bestGpsVel);
00070     std::auto_ptr<hydrointerfaces::InsGps::GenericData> novatel2Hydro(hydronovatelutil::RAWIMUSB_LOG &rawImu);
00072 
00073     bool swappedRollPitch_;
00074     double undulation_; //aka goidal separation
00075     bool haveUndulation_;
00076     struct timeval timeOfRead_;
00077 
00078     std::auto_ptr<gbxserialacfr::Serial> serial_;
00079     int baud_;
00080 
00081     hydroutil::Context context_;
00082 };
00083 
00084 
00085 // Used for dynamically loading driver
00086 class Factory : public hydrointerfaces::InsGpsFactory
00087 {
00088 public:
00089     hydrointerfaces::InsGps *createDriver( 
00090                 const hydrointerfaces::InsGps::Config &config,
00091                 const hydroutil::Context &context ) const
00092     {
00093         return new Driver( config, context );
00094     }
00095 };
00096 
00097 } // namespace
00098 
00099 // Used for dynamically loading driver
00100 extern "C" {
00101     hydrointerfaces::InsGpsFactory *createInsGpsDriverFactory();
00102 }
00103 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5