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

 

         

gpsheuristics.h

00001 /*
00002  * Orca Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This copy of Orca is licensed to you under the terms described in the
00007  * ORCA_LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 
00012 #ifndef GPS_HEURISTICS_H
00013 #define GPS_HEURISTICS_H
00014 
00015 #include <orca/gps.h>
00016 #include <orcaice/context.h>
00017 
00018 namespace gps2localise2d {
00019 
00020     
00021 //
00022 // @brief A bunch of heuristics which are used to discard suspicious GPS frames
00023 // 
00024 // @author Tobias Kaupp
00025 //    
00026 class GpsHeuristics
00027 {
00028 
00029 public:
00030     
00031     GpsHeuristics( const orcaice::Context &context,
00032                    const double           &maxSpeed );
00033     
00034     // Returns true if there are enough satellites
00035     bool haveEnoughSatellites( int numSat );
00036     
00037     // Returns true if we have a valid fix
00038     bool haveValidFix( const orca::GpsPositionType &type );
00039     
00040     // Checks two things: (1) whether the reported speed is consistent with the speed 
00041     // calculated based on position diffs, and (2) whether we have 'teleoported' based
00042     // on the maximum speed the vehicle can do
00043     // Returns 0 if ok (both checks pass), 1 if not ok (at least one check fails), and 2 if we can't determine
00044     int checkSpeedAndPosition( const double     &northing,
00045                                const double     &easting,
00046                                const double     &speedReported,
00047                                const orca::Time &timeStamp );
00048     
00049 private:
00050     
00051     orcaice::Context context_;
00052     
00053     // one-step memory to compute differentials
00054     bool firstTime_;
00055     double lastEasting_;
00056     double lastNorthing_;
00057     orca::Time lastTimeStamp_;
00058     
00059     // config variables
00060     double maxSpeed_;
00061     int minNumSatellites_;
00062     double maxTimeDiff_;
00063     double speedDiffFactor_;
00064     
00065     void saveData( const double     &northing,
00066                    const double     &easting,
00067                    const orca::Time &timeStamp );
00068 
00069 };
00070 
00071 }
00072 
00073 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5