gps.h
00001 /* 00002 * Player - One Hell of a Robot Server 00003 * Copyright (C) 2000 Brian Gerkey & Kasper Stoy 00004 * gerkey@usc.edu kaspers@robotics.usc.edu 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 /************************************************************************** 00022 * Desc: Sensor model for GPS. 00023 * Author: Andrew Howard 00024 * Date: 8 Aug 2003 00025 * CVS: $Id: gps.h 1685 2003-08-17 18:51:44Z inspectorg $ 00026 *************************************************************************/ 00027 00028 #ifndef GPS_H 00029 #define GPS_H 00030 00031 #include "../pf/pf.h" 00032 #include "../pf/pf_pdf.h" 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif 00037 00038 00039 // Model information 00040 typedef struct 00041 { 00042 // UTM origin: UTM coord that maps to (0, 0) in global coords 00043 double utm_base_e, utm_base_n; 00044 00045 // UTM grid coordinates 00046 double utm_e, utm_n; 00047 00048 // Circular horizontal error 00049 double err_horz; 00050 00051 // PDF used for initialization 00052 pf_pdf_gaussian_t *pdf; 00053 00054 } gps_model_t; 00055 00056 00057 // Create an sensor model 00058 gps_model_t *gps_alloc(); 00059 00060 // Free an sensor model 00061 void gps_free(gps_model_t *sensor); 00062 00063 // Set the observed gps coordinates (UTM grid coordinates) 00064 void gps_set_utm(gps_model_t *self, double utm_e, double utm_n, double err_horz); 00065 00066 // Prepare to initialize the distribution 00067 void gps_init_init(gps_model_t *self); 00068 00069 // Finish initializing the distribution 00070 void gps_init_term(gps_model_t *self); 00071 00072 // The sensor initialization function 00073 pf_vector_t gps_init_model(gps_model_t *self); 00074 00075 // The sensor model function 00076 double gps_sensor_model(gps_model_t *self, pf_vector_t pose); 00077 00078 #ifdef __cplusplus 00079 } 00080 #endif 00081 00082 #endif 00083