1 package grl.flatBufferTesting;
3 import java.nio.ByteBuffer;
4 import java.util.Arrays;
8 import com.google.flatbuffers.FlatBufferBuilder;
13 static final String ADDRESS =
"tcp://127.0.0.1:5563";
14 static final int NUM_MSG = 10;
15 public static void main(String[] args)
throws Exception {
18 ZMQ.Context context = ZMQ.context(1);
19 ZMQ.Socket publisher = context.socket(ZMQ.DEALER);
20 publisher.bind(ADDRESS);
21 publisher.setHWM(1000000);
22 publisher.setSndHWM(1000000);
25 FlatBufferBuilder fbb =
new FlatBufferBuilder(1);
34 byte [] sendByteArray = fbb.sizedByteArray();
35 System.out.println(sendByteArray);
36 ByteBuffer bb = ByteBuffer.wrap(sendByteArray);
43 System.out.println(Arrays.toString(position));
44 System.out.println(Arrays.toString(rotation));
45 System.out.println(vel_rel);
51 publisher.send(sendByteArray,0);
static int endVrepControlPoint(FlatBufferBuilder builder)
static void addPosition(FlatBufferBuilder builder, int positionOffset)
static void startVrepControlPoint(FlatBufferBuilder builder)
static void addRelativeVelocity(FlatBufferBuilder builder, double relativeVelocity)
static void main(String[] args)
static int createVector3d(FlatBufferBuilder builder, double x, double y, double z)
static void addRotation(FlatBufferBuilder builder, int rotationOffset)
static void finishVrepControlPointBuffer(FlatBufferBuilder builder, int offset)
static VrepControlPoint getRootAsVrepControlPoint(ByteBuffer _bb)
double relativeVelocity()