I've used the version from your initial commit before and it worked fine, ofc I had to also change the length of the realtime message or only loop over the array, not the available data.
But when you changed the readSocket() function, I think there is just a small mistake in the array length calculations after changing from the initial commit, where you set the length of the double array to the length of the input bytes.
// Read the integer available in stream
int length = in.readInt();
System.out.println("Length is "+length);
// Initialize size of RealtimeMessage be using received length
RealtimeMessage = new double[length];
// Add length integer to output array
RealtimeMessage[0] = length;
// Calculate how much data is available from the length
int data_available = (length-4)/8;
System.out.println("There are "+data_available+" doubles available");
// Loop over reading the available data
int i = 1;
while (i <= dataAvailable) {
...
which gives a double[] of length 1220 for the 153 values from the documentation.
I think should be the data_available and while i < data_available right?
// Read the integer available in stream
int byteLength = in.readInt();
System.out.println("Length is "+length);
// Calculate how much data is available from the length (Add 4 for the int -> double conversion for the length the 0th index)
int dataAvailable = (byteLength + 4) / 8;
System.out.println("There are "+data_available+" doubles available");
// Initialize size of RealtimeMessage be using received length
double[] realtimeMessage = new double[dataAvailable];
// Add byte length integer to double output array
realtimeMessage[0] = byteLength;
// Loop over reading the available data
int i = 1;
while (i < dataAvailable) {
...
I should note, I haven't tested this on a robot or a simulator, I was writing unit tests first and it this didn't work according to the documentation from ClientInterfaces_Realtime.pdf from this article
I've used the version from your initial commit before and it worked fine, ofc I had to also change the length of the realtime message or only loop over the array, not the available data.
But when you changed the readSocket() function, I think there is just a small mistake in the array length calculations after changing from the initial commit, where you set the length of the double array to the length of the input bytes.
which gives a
double[]of length 1220 for the 153 values from the documentation.I think should be the data_available and while i < data_available right?
I should note, I haven't tested this on a robot or a simulator, I was writing unit tests first and it this didn't work according to the documentation from ClientInterfaces_Realtime.pdf from this article