amcl_gps.h

00001 /*
00002  *  Player - One Hell of a Robot Server
00003  *  Copyright (C) 2000  Brian Gerkey et al.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  */
00021 //
00022 // Desc: GPS sensor model for AMCL
00023 // Author: Andrew Howard
00024 // Date: 17 Aug 2003
00025 // CVS: $Id: amcl_gps.h 2394 2004-09-07 00:20:48Z gerkey $
00026 //
00028 
00029 #ifndef AMCL_GPS_H
00030 #define AMCL_GPS_H
00031 
00032 #include "amcl_sensor.h"
00033 #include "models/gps.h"
00034 
00035 // Gpsetric sensor model
00036 class AMCLGps : public AMCLSensor
00037 {
00038   // Default constructor
00039   public: AMCLGps();
00040   
00041   // Load the model
00042   public: virtual int Load(ConfigFile* cf, int section);
00043 
00044   // Unload the model
00045   public: virtual int Unload(void);
00046 
00047   // Initialize the model
00048   public: virtual int Setup(void);
00049 
00050   // Finalize the model
00051   public: virtual int Shutdown(void);
00052 
00053   // Check for new sensor measurements
00054   private: virtual bool GetData(void);
00055 
00056   // Initialize the filter based on the sensor model.  Returns true if the
00057   // filter has been initialized.
00058   public: virtual bool InitSensor(pf_t *pf, pf_vector_t mean, pf_matrix_t cov);
00059 
00060   // Update the filter based on the sensor model.  Returns true if the
00061   // filter has been updated.
00062   public: virtual bool UpdateSensor(pf_t *pf);
00063   
00064   // Device info
00065   private: int gps_index;
00066   private: Driver *device;
00067 
00068   // Gpsetry sensor/action model
00069   private: gps_model_t *model;
00070 
00071   // Current data timestamp
00072   private: uint32_t tsec, tusec;
00073 
00074   // Current GPS data
00075   private: double utm_e, utm_n;
00076   private: double err_horz;
00077 
00078 #ifdef INCLUDE_RTKGUI
00079   // Setup the GUI
00080   private: virtual void SetupGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00081 
00082   // Finalize the GUI
00083   private: virtual void ShutdownGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00084 
00085   // Draw sensor data
00086   private: virtual void UpdateGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00087 
00088   // GPS figure
00089   private: rtk_fig_t *fig;
00090 #endif
00091 };
00092 
00093 
00094 
00095 
00096 #endif

Last updated 12 September 2005 21:38:45