]> rtime.felk.cvut.cz Git - orte.git/commitdiff
ROBOT_DEMO: MessageData clean up
authorMartin Vajnar <martin.vajnar@gmail.com>
Fri, 26 Jul 2013 08:59:36 +0000 (10:59 +0200)
committerMartin Vajnar <martin.vajnar@gmail.com>
Fri, 26 Jul 2013 08:59:36 +0000 (10:59 +0200)
orte/Robot_Demo/src/org/ocera/orte/demo/HokuyoScanType.java
orte/Robot_Demo/src/org/ocera/orte/demo/SpeedMotionType.java

index 4a9cebb6b69b9ad5c7f3eedaf8b6305779df5728..da0362e0f1461774a1627f4441e50e1d4d903110 100644 (file)
@@ -6,21 +6,16 @@ import org.ocera.orte.types.ORTEConstant;
 
 public class HokuyoScanType extends MessageData {
        
-       private int counter = 0;
-       
        public  int[]   hokuyo = new int[681];
 
        public HokuyoScanType(DomainApp domainApp, String newTopic) {
            super();
-               if(counter == 0) {
-                    boolean b;
-                    counter++;
-                this.setTopic(newTopic); 
-                b = domainApp.regNewDataType("hokuyo_scan",getMaxDataLength()); 
-                    if (b == false) {
-                      System.out.println(":j!: cannot register data type!");    
-                    }
-               }
+            boolean b;
+            this.setTopic(newTopic); 
+            b = domainApp.regNewDataType("hokuyo_scan",getMaxDataLength()); 
+            if (b == false) {
+             System.out.println(":j!: cannot register data type!");    
+           }
        }
 
        @Override
index e953f19150bd33677ce2e524b010d03c0243c8b1..6ed08b0fafb54ece28206929b51e12f60af42e56 100644 (file)
@@ -6,21 +6,16 @@ import org.ocera.orte.types.*;
 
 public class SpeedMotionType extends MessageData
 {
-   private int counter = 0;
-
    public  short[]     speed = new short[2];
    
   public SpeedMotionType(DomainApp domainApp, String newTopic) {
     super();
-       if(counter == 0) {
-            boolean b;
-            counter++;
-         this.setTopic(newTopic);
-        b = domainApp.regNewDataType("motion_speed",getMaxDataLength()); 
-            if (b == false) {
-              System.out.println(":j!: cannot register data type!");    
-            }
-       }
+    boolean b;
+    this.setTopic(newTopic);
+    b = domainApp.regNewDataType("motion_speed",getMaxDataLength()); 
+    if (b == false) {
+      System.out.println(":j!: cannot register data type!");    
+    }
   }
       
   @Override
@@ -52,4 +47,4 @@ public class SpeedMotionType extends MessageData
        return data;      
   }
   
-}  
\ No newline at end of file
+}