Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

amcl_laser.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: LASER sensor model for AMCL
00023 // Author: Andrew Howard
00024 // Date: 17 Aug 2003
00025 // CVS: $Id: amcl_laser.h,v 1.7 2004/11/12 20:02:14 gerkey Exp $
00026 //
00028 
00029 #ifndef AMCL_LASER_H
00030 #define AMCL_LASER_H
00031 
00032 #include "amcl_sensor.h"
00033 #include "map/map.h"
00034 #include "models/laser.h"
00035 
00036 
00037 // Laser sensor data
00038 class AMCLLaserData : public AMCLSensorData
00039 {
00040   // Laser range data (range, bearing tuples)
00041   public: int range_count;
00042   public: double ranges[PLAYER_LASER_MAX_SAMPLES][2];
00043 };
00044 
00045 
00046 // Laseretric sensor model
00047 class AMCLLaser : public AMCLSensor
00048 {
00049   // Default constructor
00050   public: AMCLLaser(player_device_id_t id);
00051   
00052   // Load the model
00053   public: virtual int Load(ConfigFile* cf, int section);
00054 
00055   // Unload the model
00056   public: virtual int Unload(void);
00057 
00058   // Initialize the model
00059   public: virtual int Setup(void);
00060 
00061   // Finalize the model
00062   public: virtual int Shutdown(void);
00063 
00064   // Check for new sensor measurements
00065   private: virtual AMCLSensorData *GetData(void);
00066   
00067   // Update the filter based on the sensor model.  Returns true if the
00068   // filter has been updated.
00069   public: virtual bool UpdateSensor(pf_t *pf, AMCLSensorData *data);
00070 
00071   // Determine the probability for the given pose
00072   private: static double SensorModel(AMCLLaserData *data, pf_vector_t pose);
00073 
00074   // retrieve the map
00075   private: int SetupMap(void);
00076 
00077   // Device info
00078   private: player_device_id_t laser_id;
00079   private: player_device_id_t map_id;
00080   private: Driver *driver;
00081 
00082   // Current data timestamp
00083   private: struct timeval time;
00084 
00085   // The laser map
00086   private: map_t *map;
00087 
00088   // Laser offset relative to robot
00089   private: pf_vector_t laser_pose;
00090   
00091   // Max beams to consider
00092   private: int max_beams;
00093 
00094   // Max valid laser range
00095   private: double range_max;
00096   
00097   // Laser range variance
00098   private: double range_var;
00099 
00100   // Probability of bad range readings
00101   private: double range_bad;
00102 
00103 #ifdef INCLUDE_RTKGUI
00104   // Setup the GUI
00105   private: virtual void SetupGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00106 
00107   // Finalize the GUI
00108   private: virtual void ShutdownGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig);
00109 
00110   // Draw sensor data
00111   public: virtual void UpdateGUI(rtk_canvas_t *canvas, rtk_fig_t *robot_fig, AMCLSensorData *data);
00112 
00113   // Figures
00114   private: rtk_fig_t *fig, *map_fig;
00115 #endif
00116 };
00117 
00118 
00119 
00120 
00121 #endif

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