double dleft, dright, dtang, dphi;
static bool first_run = true;
/* spocitat prevodovy pomer */
- const double n = (double)(28.0 / 1.0);
+ const double n = (double)(29.0 / 1.0);
/* vzdalenost na pulz IRC */
- const double c = (M_PI*2*ROBOT_WHEEL_RADIUS_M) / (n * 4*500.0);
-
+ const double c = (M_PI*2*ROBOT_WHEEL_RADIUS_M) / (n * 4*512.0);
switch (info->status) {
case NEW_DATA:
if (first_run) {
break;
}
- dleft = ((robot.motion_irc.left - instance->left) >> 8) * c;
- dright = ((instance->right - robot.motion_irc.right) >> 8) * c;
+
+ 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);