beacon_xy[i][1] = bp[i].y;
}
- /*FIXME: is initial pos set correctly??*/
ROBOT_LOCK(est_pos_uzv);
real_t xy0[] = {robot.est_pos_uzv.x, robot.est_pos_uzv.y};
y[3] = y[4] = 0.0;
DBG("EKF: x=%f y=%f phi=%8.4f\n", x[0], x[1], x[6]*(180.0/M_PI));
ROBOT_LOCK(est_pos_uzv);
- robot.est_pos_uzv.x = x[0] - ODO_D*cos(x[6]);
- robot.est_pos_uzv.y = x[1] - ODO_D*sin(x[6]);
- robot.est_pos_uzv.phi = x[6];
+ if (!init_ekf_flag) {
+ robot.est_pos_uzv.x = x[0] - ODO_D*cos(x[6]);
+ robot.est_pos_uzv.y = x[1] - ODO_D*sin(x[6]);
+ robot.est_pos_uzv.phi = x[6];
+ }
ROBOT_UNLOCK(est_pos_uzv);
}