1 package org.ocera.orte.demo;
3 import org.ocera.orte.*;
4 import org.ocera.orte.types.*;
7 public class SpeedMotionType extends MessageData
9 private int counter = 0;
11 public short[] speed = new short[2];
13 public SpeedMotionType(DomainApp domainApp, String newTopic) {
18 this.setTopic(newTopic);
19 b = domainApp.regNewDataType("motion_speed",getMaxDataLength(),this.buffer);
21 System.out.println(":j!: cannot register data type!");
30 buffer.putShort(this.speed[0]);
31 buffer.putShort(this.speed[1]);
38 public int getMaxDataLength()
41 len += ORTEConstant.SHORT_FIELD_SIZE;
42 len += ORTEConstant.SHORT_FIELD_SIZE;
46 public String toString()
48 String data = new String();
50 data += (" left = " + speed[0]);
51 data += (" right = " + speed[1]);