1 package org.ocera.orte.demo;
3 import org.ocera.orte.*;
4 import org.ocera.orte.types.*;
7 public class SpeedMotionType extends MessageData
9 public short[] speed = new short[2];
11 public SpeedMotionType(DomainApp domainApp, String newTopic) {
13 this.setTopic(newTopic);
14 if (!domainApp.regNewDataType("motion_speed",getMaxDataLength())) {
15 System.out.println(":j!: cannot register data type \"motion_speed\"!");
23 buffer.putShort(this.speed[0]);
24 buffer.putShort(this.speed[1]);
31 public int getMaxDataLength()
33 return 2 * ORTEConstant.SHORT_FIELD_SIZE;
36 public String toString()
40 data += (" left = " + speed[0]);
41 data += (" right = " + speed[1]);