laser_data.h
Go to the documentation of this file.
00001 #ifndef H_LASER_DATA
00002 #define H_LASER_DATA
00003 
00004 #include <sys/time.h>
00005 #include <stdio.h>
00006 
00007 #include "restrict.h"
00008 
00009 struct correspondence;
00010 
00011 typedef struct {
00012         double p[2];
00013         double rho, phi;
00014 } point2d;
00015 
00016 struct laser_data {
00017         int nrays;
00018         double  min_theta;
00019         double  max_theta;
00020         
00021         double * restrict theta;
00022         
00023         int    * restrict valid;
00024         double * restrict readings;
00025         
00026         int    * restrict cluster;
00027         
00028         double * restrict alpha;
00029         double * restrict cov_alpha;
00030         int    * restrict alpha_valid;
00031 
00032         double * restrict readings_sigma;
00033 
00034         double * restrict true_alpha;
00035         
00036         struct correspondence*  restrict corr;
00037 
00038         double true_pose[3];            
00039         double odometry[3];     
00040         double estimate[3];     
00041         
00042 
00044         point2d *  restrict points;
00047         point2d *  restrict points_w;
00048 
00050         struct timeval tv;
00051         char hostname[32];
00052 
00053 
00054         /* Jump tables needed by find_correspondences_tricks(). */
00055         int * restrict up_bigger, 
00056             * restrict up_smaller, 
00057             * restrict down_bigger, 
00058             * restrict down_smaller;    
00059 };
00060 
00061 struct correspondence {
00063         int valid; 
00065         int j1;
00067         int j2;
00069         enum { corr_pp = 0, corr_pl = 1} type;
00071         double dist2_j1; 
00072 };
00073 
00074 typedef struct laser_data* LDP;
00075 
00077 LDP ld_alloc_new(int nrays);
00078 
00080 void ld_free(LDP);
00081 
00083 void ld_alloc(LDP, int nrays);
00084 
00086 void ld_dealloc(LDP);
00087 
00089 void ld_compute_cartesian(LDP);
00090 
00092 void ld_compute_world_coords(LDP, const double *pose);
00093 
00095 void ld_create_jump_tables(LDP);
00096 
00098 unsigned int ld_corr_hash(LDP);
00099 
00101 int ld_num_valid_correspondences(LDP);
00102 
00104 int ld_valid_fields(LDP);
00105 
00107 void ld_simple_clustering(LDP ld, double threshold);
00108 
00110 void ld_compute_orientation(LDP ld, int size_neighbourhood, double sigma);
00111 
00112 
00113 
00114 
00121 LDP ld_read_smart(FILE*);
00122 
00126 LDP ld_read_smart_string(const char*);
00127 
00128 
00133 int ld_read_next_laser_carmen(FILE*, LDP*ld);
00134 
00136 LDP ld_from_carmen_string(const char*line);
00137 
00139 int ld_read_all(FILE*file, LDP **array, int*num);
00140 
00142 int ld_read_some_scans(FILE*file, LDP **array, int*num, int interval);
00143 
00145 void ld_write_as_carmen(LDP ld, FILE * stream);
00146 
00148 void ld_write_format(LDP ld, FILE*stream, const char * out_format);
00149 
00150 
00151 void possible_interval(
00152         const double *p_i_w, LDP laser_sens, 
00153         double max_angular_correction_deg, double max_linear_correction, int*from, int*to, int*start_cell);
00154 
00155 
00156 #include "laser_data_inline.h"
00157 
00158 #endif
00159 


csm
Author(s): Andrea Censi
autogenerated on Mon Jan 16 2017 03:48:29