]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
sharp sensor for puck measurement: data treatment finally works fine
authorFilip Jares <filipjares@post.cz>
Fri, 10 Apr 2009 12:48:36 +0000 (14:48 +0200)
committerFilip Jares <filipjares@post.cz>
Fri, 10 Apr 2009 12:48:36 +0000 (14:48 +0200)
src/cand/cand.cc
src/types/robottype.idl

index 0412d91c214f2364e90a614f2a79402e61c047e9..ade7b35b9981ede90785e586f5ed7f6868d530e2 100644 (file)
@@ -339,8 +339,8 @@ int cand_parse_frame(struct robottype_orte_data *orte, struct can_frame frame)
                        
                        break;
                case CAN_ADC_1: /* data from the sharp sensor measuring distance of the puck (column element) */
-                       orte->puck_distance.distance = ((frame.data[0]<<8)|(frame.data[1]));
-                       //orte->puck_distance.distance = s_gp2d120_ir2mmShort((frame.data[0]<<8)|(frame.data[1]))/1000.0;
+                       //orte->puck_distance.distance = ((frame.data[0]<<8)|(frame.data[1]));
+                       orte->puck_distance.distance = puckSharp_ir2mm((frame.data[0]<<8)|(frame.data[1]))/1000.0;
                        ORTEPublicationSend(orte->publication_puck_distance);
                        break;
 
index 51b7677cb7a748ba9bdc4c3e51fea0bb728aeddf..c8fbad355e0daa512609e0d6c8851dced8abd466 100644 (file)
@@ -129,7 +129,7 @@ struct pusher {
 /** Status of the distance measurement sensor */
 struct puck_distance {
        /** Distance of the puck from the Sharp sensor */
-       short distance;
+       double distance;
 };
 
 /** Status sent from actuators */