Hi Gabriele
>From the plot it looks like you are plotting uncalibrated data. By calibrating your sensors you should be able to get results with better accuracy. I would suggest taking a look at the following video <http://www.youtube.com/watch?v=FRZ6bzX6Dd0> http://www.youtube.com/watch?v=FRZ6bzX6Dd0 as well as reading the <http://www.shimmer-research.com/wp-content/uploads/2012/02/Shimmer-9DoF-Cal ibration-User-Manual.pdf> Shimmer 9DoF Calibration Application User Manual ( <http://www.shimmer-research.com/download/documentation> http://www.shimmer-research.com/download/documentation) for further information. The source code can be retrieved from the jar file. You will have to extract the jar file using an application like WinRaR. Best regards, JC _____ From: Gabriele Spina [mailto:[email protected]] Sent: 10 October 2012 15:21 To: Jong Chern Lim Cc: [email protected]; Frank Roberts Subject: Re: [Shimmer-users] Shimmer + Android (Blue tooth) Dear Jong Chern, thank you for your reply! Basically I connected two shimmer sensors together (with some tape). One of them is sending data via bluetooth to the android phone, the other is storing data into the SD card (both the sampling frequencies are 250Hz). Then I synchronized the 2 outputs and I plotted them. I've attached the resulting picture...as you can see the values don't match...the experiment was not so accurate since I used tape to connect them and the sensors were not perfectly aligned (I did my best)... Would it be possible to merge the ParamLogging firmware with the BoilerPlate one in order to use only 1 sensor to run this test? Maybe there is already the code around... Regarding the the Android Instrument Driver: would it be possible to have the source code together with the jar file? Best regards, Gabriele On 10 October 2012 15:51, Jong Chern Lim <[email protected]> wrote: Hi Gabriele, Concerning the shift in values, can you elaborate a little on your experiment setup, and the results you obtained? The manner you are reading the byte one at a time till you detect a full packet, would be a correct approach. We use the same approach in our provided Shimmer Android Instrument Driver which can be found here http://www.shimmer-research.com/download/softwares. Best regards, JC _____ From: [email protected] [mailto:[email protected]] On Behalf Of Gabriele Spina Sent: 10 October 2012 14:23 To: [email protected] Cc: Frank Roberts Subject: [Shimmer-users] Shimmer + Android (Blue tooth) Dear all, I have written some code in Java for Android as part of a larger framework that can read streaming Shimmer data over Bluetooth. To test it's accuracy we connected two Shimmer devices, one that streams over Bluetooth and another that stores data on the Shimmer itself. When we compared results there appears to be a slight shift in the values (I only tested with accelerometer data). I would like to know if there is an explanation for this besides sensor displacement. Another question I had relates to the sampling rates of the sensors and the transmission rate of the Bluetooth radio. When I sample the sensors at 250 Hz will I then also receive the packets at this frequency? I read one byte at a time from the Bluetooth socket and when I have received a full packet I decode it as follows: public float[] decodeSensorData(byte[] data, int size) { float[] values = new float[(mNumChannels+1)]; if (data[0] == PACKET_START) { for (int j = 0, k = 0; j < mNumChannels; j++, k += 2) { values[j] = getChannel(data[4+k], data[3+k]); } values[mNumChannels] = getChannel(data[2], data[1]); return values; } else { Log.d("Shimmer", "Package error"); return null; } } private float getChannel(byte high, byte low) { float temp = 0; temp = (short)(high << 8) | (low & 0xFF); if (((short)temp & 0x8000) > 0) { temp = (long)temp & 0xFFFF; } return temp; } I then send the data to native library for further processing. I would like to thank you in advance, Gabriele
_______________________________________________ Shimmer-users mailing list [email protected] https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users
