mcl_SOURCES = mcl.c mcl_laser.c
mcl_LIBS = robomath m
-include_HEADERS = mcl.h mcl_laser.h
+include_HEADERS = mcl.h mcl_laser.h mcl_robot.h
# -ffast-math is the most important optimization here
CFLAGS := $(filter-out -fno-strict-aliasing,$(CFLAGS)) --std=c99 -D_GNU_SOURCE -ffast-math -O3 -funroll-loops -ftree-vectorize
{
struct mcl_laser *l = mcl_to_laser(mcl);
struct mcl_laser_state *parts = l->parts;
- struct mcl_laser_state *d = delta;
+ struct mcl_robot_odo *d = delta;
struct mcl_laser_state *estimated = mcl->estimated;
int i=0;
/* move the particles with noises */
for (i=0; i<mcl->count; i++) {
double a = parts[i].angle;
- xdiff = d->x*cos(a) - d->y*sin(a);
- ydiff = d->y*cos(a) + d->x*sin(a);
+ xdiff = d->dx*cos(a) - d->dy*sin(a);
+ ydiff = d->dy*cos(a) + d->dx*sin(a);
parts[i].x += xdiff + l->pred_dnoise*gaussian_random();
parts[i].y += ydiff + l->pred_dnoise*gaussian_random();
- parts[i].angle += d->angle + l->pred_anoise*gaussian_random();
+ parts[i].angle += d->dangle + l->pred_anoise*gaussian_random();
/* if (drand48() < l->beacon_miss) parts[i].beacon++; */
/* if (drand48() < l->false_beacon) parts[i].beacon--; */
/* if (parts[i].beacon >= BEACON_CNT) */
/* Update the last estimated position without noise */
a = estimated->angle;
- estimated->x += d->x*cos(a) - d->y*sin(a);
- estimated->y += d->x*sin(a) + d->y*cos(a);
- estimated->angle += d->angle;
+ estimated->x += d->dx*cos(a) - d->dy*sin(a);
+ estimated->y += d->dx*sin(a) + d->dy*cos(a);
+ estimated->angle += d->dangle;
}
static inline double gaussian(double val, double sigma)