Changeset 172:7a4a6f7629b7 in finroc_plugins_data_types-java


Ignore:
Timestamp:
13.11.2019 12:01:55 (3 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
default
Phase:
public
Message:

Adds native support for lists of Angles and Poses

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Angle.java

    r171 r172  
    3333import org.rrlib.serialization.rtti.Copyable; 
    3434import org.rrlib.serialization.rtti.DataType; 
     35import org.rrlib.serialization.rtti.datatype.DoubleList; 
    3536 
    3637/** 
     
    4243 
    4344    /** Data Type */ 
    44     public final static DataType<Angle> TYPE = new DataType<Angle>(Angle.class); 
     45    public final static DataType<Angle> TYPE = new DataType<Angle>(Angle.class, AngleList.class, "Angle"); 
    4546 
    4647    static { 
     
    133134        } 
    134135    } 
     136 
     137    public static class AngleList extends DoubleList { 
     138 
     139    } 
    135140} 
  • Pose2D.java

    r171 r172  
    2626import org.finroc.core.portdatabase.CCType; 
    2727import org.finroc.core.portdatabase.FinrocTypeInfo; 
     28import org.rrlib.serialization.ArrayBuffer.Channel; 
     29import org.rrlib.serialization.ArrayBuffer.AttributeType; 
    2830import org.rrlib.serialization.BinaryInputStream; 
    2931import org.rrlib.serialization.BinaryOutputStream; 
     
    3537import org.rrlib.serialization.rtti.Copyable; 
    3638import org.rrlib.serialization.rtti.DataType; 
     39import org.rrlib.serialization.rtti.datatype.ArrayBufferPortDataList; 
    3740 
    3841/** 
     
    4447 
    4548    /** Data Type */ 
    46     public final static DataType<Pose2D> TYPE = new DataType<Pose2D>(Pose2D.class, "rrlib.localization.Pose2D"); 
     49    public final static DataType<Pose2D> TYPE = new DataType<Pose2D>(Pose2D.class, Pose2DList.class, "rrlib.localization.Pose2D"); 
    4750 
    4851    static { 
     
    140143        yaw = 0; 
    141144    } 
     145 
     146    private static final Channel[] CHANNELS = { new Channel(AttributeType.DOUBLE, 0, 3 * 8, "X"), new Channel(AttributeType.DOUBLE, 8, 3 * 8, "Y"), new Channel(AttributeType.DOUBLE, 16, 3 * 8, "Yaw") }; 
     147 
     148    public static class Pose2DList extends ArrayBufferPortDataList { 
     149 
     150        public Pose2DList() { 
     151            super(CHANNELS, Pose2D.TYPE); 
     152        } 
     153    } 
    142154} 
  • Pose3D.java

    r171 r172  
    2828import org.rrlib.serialization.StringInputStream; 
    2929import org.rrlib.serialization.StringOutputStream; 
     30import org.rrlib.serialization.ArrayBuffer.AttributeType; 
     31import org.rrlib.serialization.ArrayBuffer.Channel; 
    3032import org.rrlib.serialization.rtti.DataType; 
     33import org.rrlib.serialization.rtti.datatype.ArrayBufferPortDataList; 
    3134 
    3235/** 
     
    3841 
    3942    /** Data Type */ 
    40     public final static DataType<Pose3D> TYPE = new DataType<Pose3D>(Pose3D.class, "rrlib.localization.Pose3D"); 
     43    public final static DataType<Pose3D> TYPE = new DataType<Pose3D>(Pose3D.class, Pose3DList.class, "rrlib.localization.Pose3D"); 
    4144 
    4245    static { 
     
    164167        } 
    165168    } 
     169 
     170    private static final Channel[] CHANNELS = { new Channel(AttributeType.DOUBLE, 0, 6 * 8, "X"), new Channel(AttributeType.DOUBLE, 8, 6 * 8, "Y"), new Channel(AttributeType.DOUBLE, 16, 6 * 8, "Z"), 
     171                new Channel(AttributeType.DOUBLE, 24, 6 * 8, "Roll"), new Channel(AttributeType.DOUBLE, 32, 6 * 8, "Pitch"), new Channel(AttributeType.DOUBLE, 40, 6 * 8, "Yaw") 
     172    }; 
     173 
     174    public static class Pose3DList extends ArrayBufferPortDataList { 
     175 
     176        public Pose3DList() { 
     177            super(CHANNELS, Pose3D.TYPE); 
     178        } 
     179    } 
    166180} 
Note: See TracChangeset for help on using the changeset viewer.