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

 

         

insgpsnovatelspan/driver.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 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 INSPVASB_LOG ;
00025     struct RAWIMUSB_LOG ;
00026 }
00027 // users don't need to know about serial devices
00028 namespace gbxserialacfr{
00029     class Serial;
00030 }
00031 
00032 namespace insgpsnovatelspan{
00033 
00034 /*
00035 @brief class which handles interactions with the
00036        Novatel Span InsGps navigation sensors
00037 
00038 @author Matthew Ridley, Ben Upcroft, Michael Moser
00039  */
00040 union novatel_message;
00041 class Driver : public hydrointerfaces::InsGps
00042 {
00043 public:
00044 
00045     Driver( const Config &cfg, const hydroutil::Context &context );
00046     virtual ~Driver();
00047 
00048     // from InsGps
00049     virtual std::auto_ptr<hydrointerfaces::InsGps::GenericData> read();
00050 
00051 private:
00052 
00054     int connectToHardware();
00056     void configureImu();
00058     void configureGps();
00060     void requestData();
00064     int readNovatelMessage( union novatel_message &msg );
00067     std::auto_ptr<hydrointerfaces::InsGps::GenericData> novatel2Hydro(hydronovatelutil::INSPVASB_LOG &insPva);
00068     std::auto_ptr<hydrointerfaces::InsGps::GenericData> novatel2Hydro(hydronovatelutil::BESTGPSPOS_LOG &bestGpsPos);
00069     std::auto_ptr<hydrointerfaces::InsGps::GenericData> novatel2Hydro(hydronovatelutil::RAWIMUSB_LOG &rawImu);
00071 
00072     bool swappedRollPitch_;
00073     struct timeval timeOfRead_;
00074 
00075     std::auto_ptr<gbxserialacfr::Serial> serial_;
00076     int baud_;
00077 
00078     hydroutil::Context context_;
00079 };
00080 
00081 
00082 // Used for dynamically loading driver
00083 class Factory : public hydrointerfaces::InsGpsFactory
00084 {
00085 public:
00086     hydrointerfaces::InsGps *createDriver( 
00087                 const hydrointerfaces::InsGps::Config &config,
00088                 const hydroutil::Context &context ) const
00089     {
00090         return new Driver( config, context );
00091     }
00092 };
00093 
00094 } // namespace
00095 
00096 // Used for dynamically loading driver
00097 extern "C" {
00098     hydrointerfaces::InsGpsFactory *createDriverFactory();
00099 }
00100 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5