How to continue Motion Detection with MMRL SensorFusion after unexpected Disconnect

Hi there,

I want to detect certain motions of the upper arm by using SensorFusion. Leaving unexpected disconnects aside it works quite well so far with the following steps:
1. user places sensor on arm and stays still for a while, SensorFusion is started (as in the Meta-ROM App)
2. i take the quaternion of that initial position.
3. use initial position quaternion to interpret the new incoming quaternions as upper arm motions

Problem
after an unexpected disconnect i have to reconnect and restart the SensorFusion, which will begin with a different initial position, which in turn will mess up my motion detection. i want to avoid making the user go into the start position and stand still for a few seconds again.

Question:
1. is it possible to keep streaming the SensorFusion after a disconnect so it wont restart with fresh initial values?
2. or if i would roughly infer the sensor position with sensorFusion.GRAVITY, could I write a start quaternion into the sensorFusion so all later incoming quaternions are relative to that written start quaternion?
"sensorFusion.writeCalibrationData(startQuaternion);" as described in https://mbientlab.com/androiddocs/latest/sensor_fusion.html.

Thanks so much!

Comments

    1. No this is not possible. streaming requires a connection. You could try to go into logging mode instead after a disconnect and then back to streaming once it connects again (use our event module).
    2. You would need to do this in software.
  • Thanks for your reply!

    1. No this is not possible. streaming requires a connection. You could try to go into logging mode instead after a disconnect and then back to streaming once it connects again (use our event module).

    i like the idea, but i am struggling at implementation now. i took a look at the MetaBase source code and found the code snippets for logging and streaming with "addRouteAsync(...)".

    More Questions:
    1. What are you refering to with "event module"? i dont find anything like that in the SDK documentation.
    2. is there any example code of using this event module, even it its not about for SensorFusion?

    Thanks

Sign In or Register to comment.