From: Michal Vokac Date: Fri, 6 May 2011 08:53:30 +0000 (+0200) Subject: robofsm: Updated maxon motor gearbox reduction ratio and IRC resolution. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/eurobot/public.git/commitdiff_plain/78a81777661fbf35a46981a79349e796c2c105f4 robofsm: Updated maxon motor gearbox reduction ratio and IRC resolution. It was necessary to switch dleft and dright to view motor odometry properly in robomon. --- diff --git a/src/robofsm/robot_orte.c b/src/robofsm/robot_orte.c index 7c078e4f..0ee213b3 100644 --- a/src/robofsm/robot_orte.c +++ b/src/robofsm/robot_orte.c @@ -150,11 +150,10 @@ void rcv_motion_irc_cb(const ORTERecvInfo *info, void *vinstance, 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) { @@ -165,8 +164,9 @@ void rcv_motion_irc_cb(const ORTERecvInfo *info, void *vinstance, 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);