Correct measured distance.
void set_initial_position()
{
- robot_set_est_pos_trans(ROBOT_START_X_M,
- ROBOT_START_Y_M,
- DEG2RAD(ROBOT_START_ANGLE_DEG));
+ robot_set_est_pos_trans(ROBOT_AXIS_TO_BACK_M,
+ PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0) - 0.05,
+ 0);
}
void actuators_home()
PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0),
0);
robot_move_by(-1.1, NO_TURN(), &tcVerySlow);
- FSM_TIMER(200);
+ FSM_TIMER(150);
break;
case EV_MOTION_DONE:
ROBOT_LOCK(est_pos_odo);
fputs ("\n", file);
sprintf(buffer, "%4.4f", -1/y1);
fputs (buffer,file);
+ fputs ("\n", file);
fclose(file);
SUBFSM_RET(NULL);
break;
#define MOTION_CONTROL_INIT_ONLY
#include "motion-control.h"
+#include "robot.h"
/* Global definition of robot structure */
struct robot robot;
}
robot.odo_cal_a = a / num;
robot.odo_cal_b = b / num;
+ printf("calibrated value left: %f\n",robot.odo_cal_a);
+ printf("calibrated value right: %f\n",robot.odo_cal_b);
}
/* FIXME maybe it is not correct to do this nasty hack here (switch dleft and dright),
what is the right solution?
This was neccessary to view motor odometry correctly in robomon. */
- dright = ((robot.motion_irc.left - instance->left) >> 8) * c * robot.odo_cal_b;
- dleft = ((instance->right - robot.motion_irc.right) >> 8) * c * robot.odo_cal_a;
+ dright = ((robot.motion_irc.left - instance->left) >> 8) * c;
+ dleft = ((instance->right - robot.motion_irc.right) >> 8) * c;
dtang = (dleft + dright) / 2.0;
dphi = (dright - dleft) / (2.0*ROBOT_ROTATION_RADIUS_M);
break;
case EV_RETURN:
robot_calibrate_odometry();
- //FSM_TRANSITION(get_central_buillon_first);
+ FSM_TRANSITION(get_central_buillon_first);
break;
case EV_SWITCH_STRATEGY:
//FSM_TRANSITION(get_central_buillon_first);