summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
87747a1)
Correct measured distance.
void set_initial_position()
{
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);
PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0),
0);
robot_move_by(-1.1, NO_TURN(), &tcVerySlow);
PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0),
0);
robot_move_by(-1.1, NO_TURN(), &tcVerySlow);
break;
case EV_MOTION_DONE:
ROBOT_LOCK(est_pos_odo);
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);
sprintf(buffer, "%4.4f", -1/y1);
fputs (buffer,file);
fclose(file);
SUBFSM_RET(NULL);
break;
fclose(file);
SUBFSM_RET(NULL);
break;
#define MOTION_CONTROL_INIT_ONLY
#include "motion-control.h"
#define MOTION_CONTROL_INIT_ONLY
#include "motion-control.h"
/* Global definition of robot structure */
struct robot robot;
/* Global definition of robot structure */
struct robot robot;
}
robot.odo_cal_a = a / num;
robot.odo_cal_b = b / num;
}
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. */
/* 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);
dtang = (dleft + dright) / 2.0;
dphi = (dright - dleft) / (2.0*ROBOT_ROTATION_RADIUS_M);
break;
case EV_RETURN:
robot_calibrate_odometry();
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);
break;
case EV_SWITCH_STRATEGY:
//FSM_TRANSITION(get_central_buillon_first);