analytical() integrates vel & pos using same code as calc_position() BUT after rotating the accelerometer data, it makes q[0] the "reference position". The other 3 orientation functions do not integrate vel & pos. Suggest harmonize analytical() with the others by eliminating the vel & pos integration. Then user would call calc_position() to recalculate.
Rotating q[0] to reference pos (and applying same rot to all of the q array) loses the initial pose calculation. Please extract this into a separate function that is available to user.
analytical() integrates vel & pos using same code as calc_position() BUT after rotating the accelerometer data, it makes q[0] the "reference position". The other 3 orientation functions do not integrate vel & pos. Suggest harmonize analytical() with the others by eliminating the vel & pos integration. Then user would call calc_position() to recalculate. Rotating q[0] to reference pos (and applying same rot to all of the q array) loses the initial pose calculation. Please extract this into a separate function that is available to user.