Variable-State-Dimension Kalman-Based Filter for Orientation Determination Using Inertial and Magnetic Sensors