*/
FSM_STATE(loc_init)
{
- /* MCL initialization */
- robot.laser.width = PLAYGROUND_WIDTH_M; /* in meters */
- robot.laser.height = PLAYGROUND_WIDTH_M; /* in meters */
- /* the noises */
- robot.laser.pred_dnoise = 0.01;
- robot.laser.pred_anoise = DEG2RAD(2);
- robot.laser.aeval_sigma = DEG2RAD(4);
-
- robot.mcl = mcl_laser_init(&robot.laser, 1000);
FSM_TRANSITION(run);
}
robot.mcl->resample(robot.mcl);
break;
}
+ case EV_SET_ESTIMATED: {
+ struct mcl_robot_pos *pos = FSM_EVENT_PTR;
+ mcl->set_estimated(mcl, pos);
+ free(pos);
+ break;
+ }
case EV_ENTRY:
case EV_EXIT:
+ break;
case EV_RETURN:
case EV_TIMER:
DBG_PRINT_EVENT("unhandled event");
"loc" : {
"EV_ODO_RECEIVED" : "Execute prediction step based on odometry data",
"EV_LASER_RECEIVED" : "Execute update step based on laser measurement",
+ "EV_SET_ESTIMATED" : "Sets the estimated position to the value from event parameter",
"EV_RESET" : "Initialize MCL to uniform distribution on the whole playground",
},
"motion" : {
robot.orte.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
robot.orte.drives.bagr = BAGR_DRIVE_OFF;
+ /* MCL initialization */
+ robot.laser.width = PLAYGROUND_WIDTH_M; /* in meters */
+ robot.laser.height = PLAYGROUND_WIDTH_M; /* in meters */
+ /* the noises */
+ robot.laser.pred_dnoise = 0.01;
+ robot.laser.pred_anoise = DEG2RAD(2);
+ robot.laser.aeval_sigma = DEG2RAD(4);
+ robot.mcl = mcl_laser_init(&robot.laser, 1000);
+
+ robot.fsm[FSM_ID_MOTION].state = &fsm_state_move_init;
+ robot.fsm[FSM_ID_DISP].state = &fsm_state_disp_init;
+ robot.fsm[FSM_ID_LOC].state = &fsm_state_loc_init;
+
/* init ORTE domain, create publishers, subscribers, .. */
robot_init_orte();