Erratic sensor fusion data when using accounter count
Hi all,
I am trying to use the accounter (count mode) to get sample counts from my sensor fusion data packets to be able to better reconstruct the timestamps. I referred to the tutorials and example code and am able to get the packet number but my output values become very erratic when implementing this. I tried to use the count mode with raw acceleration data as well to see if it was potentially something to do with the sensor fusion packet size and had similar results (the data read incorrect/erratic values). I have successfully used the accounter to get reconstructed timestamps with raw accelerometer data, but this cannot be used with sensor fusion due to packet size.
I am able to stream euler angles fine off the MetaBase app and off my own python code that does not use the accounter processor, it is when I try to use the accounter (count mode) that I start getting erratic data
Here is an example of the sensor fusion euler output when i try to use the accounter count processor:
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 198286819328.000, roll : 2040491614993935165595126861922304.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 214342615040.000, roll : 1838261730176275443887605928689664.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 235637096448.000, roll : 1555971787137951609041808833642496.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 258806431744.000, roll : 1247690055034791929944229726388224.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 288461258752.000, roll : 1075190538200609900918686160519168.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 330916003840.000, roll : 977046651886064952724683592040448.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 367054127104.000, roll : 894530520627458645121007567765504.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 400063299584.000, roll : 804725398417540018458725500059648.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 80531185664.000, roll : 13693241011827848259304981568421888.000, yaw : -0.000}
DA:6A:BD:93:6C:FA -> {heading : -0.000, pitch : 6657697.500, roll : 20487910977755869148682684836045914112.000, yaw : -0.000}
I have also attached my python script. Please let me know if there is something I am missing or where this issue may be stemming from.
Thanks in advance.
Board Information - MMR
Model number: 5
Firmware:1.5.0
Hardware 0.4
Host Device Information
MetaHub (raspberry pi running Raspbian (stretch))
Comments
It looks like you are not parsing the incoming data correctly now that it has the accounter in the packet and not just the euler data.
I was passing the data to the parse value function to extract the roll, pitch and yaw, can this not be used with euler data when there is additional accounter data in the packet?
Here is my code on how i have set up the data processor and how I am trying to parse the data. A similar method works fine for only the sensor fusion data, but its when i add the accounter count processor that my data outputted from the parse value function does not make sense.
Where do you handle the counter value?
within the data handler callback
self.sample = cast(data.contents.extra, POINTER(c_uint8)).contents.value
That must not be working since everything else works fine. Not sure exactly why.
You might want to print the raw data (the sensor data packet in hex/bytes - don't parse it) and see which bytes are which.
Then make sure self.sample is actually getting the accumulator bytes and parsing it from the data:
Basically I don't think the right bytes are getting parsed correctly in your data_handler function: