localizecore.h

Go to the documentation of this file.
00001 /*********************************************************
00002  *
00003  * This source code is part of the Carnegie Mellon Robot
00004  * Navigation Toolkit (CARMEN)
00005  *
00006  * CARMEN Copyright (c) 2002 Michael Montemerlo, Nicholas
00007  * Roy, and Sebastian Thrun
00008  *
00009  * CARMEN is free software; you can redistribute it and/or 
00010  * modify it under the terms of the GNU General Public 
00011  * License as published by the Free Software Foundation; 
00012  * either version 2 of the License, or (at your option)
00013  * any later version.
00014  *
00015  * CARMEN is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied 
00017  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00018  * PURPOSE.  See the GNU General Public License for more 
00019  * details.
00020  *
00021  * You should have received a copy of the GNU General 
00022  * Public License along with CARMEN; if not, write to the
00023  * Free Software Foundation, Inc., 59 Temple Place, 
00024  * Suite 330, Boston, MA  02111-1307 USA
00025  *
00026  ********************************************************/
00027 
00029 // @{
00030 
00039 #ifndef CARMEN_LOCALIZECORE_H
00040 #define CARMEN_LOCALIZECORE_H
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 #include <carmen/map.h>
00047 #include "localize_motion.h"
00048 
00049 #define      SMALL_PROB        0.01
00050 
00052 typedef struct {
00053   double front_laser_offset, rear_laser_offset;
00054   int num_particles;
00055   double max_range, min_wall_prob, outlier_fraction;
00056   double update_distance;
00057   double integrate_angle;             
00058   int laser_skip;
00059   int use_rear_laser, do_scanmatching;
00060   int constrain_to_map;
00061 #ifdef OLD_MOTION_MODEL
00062   double odom_a1, odom_a2, odom_a3, odom_a4;
00063 #endif
00064   double occupied_prob;
00065   double lmap_std;
00066   double global_lmap_std, global_evidence_weight, global_distance_threshold;
00067   int global_test_samples;
00068   int use_sensor;
00069 #ifndef OLD_MOTION_MODEL
00070   carmen_localize_motion_model_t *motion_model;
00071 #endif  
00072 } carmen_localize_param_t, *carmen_localize_param_p;
00073 
00074 typedef struct {
00075   float x, y, theta, weight;
00076 } carmen_localize_particle_t, *carmen_localize_particle_p;
00077 
00078 typedef struct {
00079   int initialized, first_odometry, global_mode;
00080   carmen_localize_param_p param;
00081   carmen_localize_particle_p particles;
00082   carmen_point_t last_odometry_position;
00083   float **temp_weights;
00084   float distance_travelled;
00085   char laser_mask[361];
00086 } carmen_localize_particle_filter_t, *carmen_localize_particle_filter_p;
00087 
00088 typedef struct {
00089   float x, y, range;
00090   float prob;
00091   char mask;
00092 } carmen_localize_laser_point_t, *carmen_localize_laser_point_p;
00093 
00094 typedef struct {
00095   carmen_point_t mean, std;
00096   carmen_point_t odometry_pos;
00097   double xy_cov;
00098   int converged;
00099   int num_readings;
00100   carmen_localize_laser_point_t mean_scan[361];
00101 } carmen_localize_summary_t, *carmen_localize_summary_p;
00102 
00103 #include "likelihood_map.h"
00104 
00105 
00107 carmen_localize_particle_filter_p 
00108 carmen_localize_particle_filter_new(carmen_localize_param_p param);
00109 
00116 void 
00117 carmen_localize_initialize_particles_uniform(carmen_localize_particle_filter_p filter,
00118                                              carmen_robot_laser_message *laser,
00119                                              carmen_localize_map_p map);
00120   
00128 void 
00129 carmen_localize_initialize_particles_gaussians(carmen_localize_particle_filter_p filter,
00130                                                int num_modes,
00131                                                carmen_point_t *mean,
00132                                                carmen_point_t *std);
00133 
00140 void 
00141 carmen_localize_initialize_particles_gaussian(carmen_localize_particle_filter_p filter,
00142                                               carmen_point_t mean, 
00143                                               carmen_point_t std);
00144 
00145 
00150 void 
00151 carmen_localize_initialize_particles_manual(carmen_localize_particle_filter_p filter,
00152                                             double *x, 
00153                                             double *y, 
00154                                             double *theta,
00155                                             double *weight, 
00156                                             int num_particles);
00157 
00158 int 
00159 carmen_localize_initialize_particles_placename(carmen_localize_particle_filter_p filter,
00160                                                carmen_map_placelist_p placelist,
00161                                                char *placename);
00162 
00168 void 
00169 carmen_localize_incorporate_odometry(carmen_localize_particle_filter_p filter,
00170                                      carmen_point_t odometry_position);
00171 
00184 void 
00185 carmen_localize_incorporate_laser(carmen_localize_particle_filter_p filter,
00186                                   carmen_localize_map_p map, 
00187                                   int num_readings, 
00188                                   float *range, 
00189                                   double forward_offset, 
00190                                   double angular_resolution,
00191                                   double laser_maxrange,
00192                                   double first_beam_angle,
00193                                   int backwards);
00194 
00195 
00200 void 
00201 carmen_localize_resample(carmen_localize_particle_filter_p filter);
00202 
00212 void 
00213 carmen_localize_run(carmen_localize_particle_filter_p filter, 
00214                     carmen_localize_map_p map,
00215                     carmen_robot_laser_message *laser, 
00216                     double forward_offset,
00217                     int backwards);
00218 
00219 void 
00220 carmen_localize_laser_scan_gd(int num_readings, 
00221                               float *range,
00222                               double angular_resolution,
00223                               double first_beam_angle,
00224                               carmen_point_p laser_pos, 
00225                               double forward_offset,
00226                               carmen_localize_map_p map, 
00227                               int laser_skip);
00228 
00230 void 
00231 carmen_localize_summarize(carmen_localize_particle_filter_p filter, 
00232                           carmen_localize_summary_p summary, 
00233                           carmen_localize_map_p map,
00234                           int num_readings, 
00235                           float *range, 
00236                           double forward_offset,
00237                           double angular_resolution,
00238                           double first_beam_angle,
00239                           int backwards);
00240 
00241 #ifdef __cplusplus
00242 }
00243 #endif
00244 
00245 #endif
00246 // @}

Generated on Wed Apr 5 18:34:18 2006 for CARMEN by  doxygen 1.4.4