Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

amcl_sensor.h

Go to the documentation of this file.
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: Adaptive Monte-Carlo localization
00023 // Author: Andrew Howard
00024 // Date: 6 Feb 2003
00025 // CVS: $Id: amcl_sensor.h,v 1.3 2003/11/21 00:05:06 inspectorg Exp $
00026 //
00028 
00029 #ifndef AMCL_SENSOR_H
00030 #define AMCL_SENSOR_H
00031 
00032 #include "device.h"
00033 #include "configfile.h"
00034 #include "pf/pf.h"
00035 
00036 
00037 // Forward declarations
00038 class AMCLSensorData;
00039 
00040 
00041 // Base class for all AMCL sensors
00042 class AMCLSensor
00043 {
00044   // Default constructor
00045   public: AMCLSensor();
00046 
00047   // Load the model
00048   public: virtual int Load(ConfigFile* cf, int section);
00049 
00050   // Unload the model
00051   public: virtual int Unload(void);
00052 
00053   // Initialize the model
00054   public: virtual int Setup(void);
00055 
00056   // Finalize the model
00057   public: virtual int Shutdown(void);
00058 
00059   // Get new sensor data (non-blocking)
00060   public: virtual AMCLSensorData *GetData(void);
00061   
00062   // Update the filter based on the action model.  Returns true if the filter
00063   // has been updated.
00064   public: virtual bool UpdateAction(pf_t *pf, AMCLSensorData *data);
00065 
00066   // Initialize the filter based on the sensor model.  Returns true if the
00067   // filter has been initialized.
00068   public: virtual bool InitSensor(pf_t *pf, AMCLSensorData *data);
00069 
00070   // Update the filter based on the sensor model.  Returns true if the
00071   // filter has been updated.
00072   public: virtual bool UpdateSensor(pf_t *pf, AMCLSensorData *data);
00073 
00074   // Flag is true if this is the action sensor
00075   public: bool is_action;
00076 
00077   // Action pose (action sensors only)
00078   public: pf_vector_t pose;
00079 
00080 #ifdef INCLUDE_RTKGUI
00081   // Setup the GUI
00082   public: virtual void SetupGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00083 
00084   // Finalize the GUI
00085   public: virtual void ShutdownGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00086 
00087   // Draw sensor data
00088   public: virtual void UpdateGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig, AMCLSensorData *data);
00089 #endif
00090 };
00091 
00092 
00093 
00094 // Base class for all AMCL sensor measurements
00095 class AMCLSensorData
00096 {
00097   // Pointer to sensor that generated the data
00098   public: AMCLSensor *sensor;
00099 
00100   // Data timestamp
00101   public: uint32_t tsec, tusec;
00102 };
00103 
00104 
00105 
00106 #endif

Generated on Tue May 3 14:15:33 2005 for Player by doxygen 1.3.6