]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: Updated maxon motor gearbox reduction ratio and IRC resolution.
authorMichal Vokac <vokac.m@gmail.com>
Fri, 6 May 2011 08:53:30 +0000 (10:53 +0200)
committerMichal Vokac <vokac.m@gmail.com>
Fri, 6 May 2011 08:53:30 +0000 (10:53 +0200)
It was necessary to switch dleft and dright to view motor odometry properly in robomon.

src/robofsm/robot_orte.c

index 7c078e4f1266edf93a7aa4675e588879069264e7..0ee213b3a1a1d3800b3d2d4044bb682da21d6529 100644 (file)
@@ -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);