00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __mcl__
00017 #define __mcl__
00018
00019 #define POS_STDEV_FRAC 2
00020
00021
00022 struct mcl_particle {
00023 double x;
00024 double y;
00025 double angle;
00026 double weight;
00027 };
00028
00029 struct mcl_model {
00030
00031 void (*init) (struct mcl_model *mcl);
00032 void (*move) (struct mcl_model *mcl, double dx, double dy, double dangle);
00033 void (*update) (struct mcl_model *mcl, double x, double y, double angle);
00034 void (*normalize) (struct mcl_model *mcl);
00035 void (*sort) (struct mcl_model *mcl);
00036 void (*resample) (struct mcl_model *mcl);
00037
00038 void *parts;
00039 int count;
00040
00041 void *system;
00042
00043 double gen_dnoise;
00044 double gen_anoise;
00045 double mov_dnoise;
00046 double mov_anoise;
00047
00048 double w_min;
00049 double w_max;
00050 double eval_sigma;
00051
00052 int width;
00053 int height;
00054
00055 int cycle;
00056 int noisecycle;
00057
00058 int maxnoisecycle;
00059 double maxavdist;
00060 unsigned char flag;
00061 };
00062
00063 enum {
00064 MCL_STOP = 0,
00065 MCL_RUN = 1,
00066 MCL_RESET = 255
00067 };
00068
00072 void mcl_move(struct mcl_model *mcl, double dx, double dy, double dangle);
00073 void mcl_update(struct mcl_model *mcl, double x, double y, double angle);
00074 void mcl_normalize(struct mcl_model *mcl);
00075 void mcl_partsort(struct mcl_model *mcl);
00076 void mcl_resample(struct mcl_model *mcl);
00077 void mcl_init (struct mcl_model *mcl);
00078 inline struct mcl_particle mcl_get_pos(struct mcl_model *mcl);
00079
00080 #endif