Skip to content

SageMotionApps/Core-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms

This repo includes common algorithms, such as gait phase detection and yaw correction, that SageMotion apps use. As we develop more apps and share more algorithms between them, we will add those here as well.

Algorithms included

  • GaitPhase1.py: Four-state gait phase estimator (early/mid/late stance and swing). Tracks gyro magnitude to detect heel strike and toe off, adapts stance timing per step, and increments a step counter when switching from swing to stance.
  • GaitPhase2.py: Simplified two-state gait detector (stance vs swing). Uses gyro magnitude thresholds and a stance duration estimate to transition; updates last stance time to stay responsive to slower/faster cadence.
  • Rotation.py: Thin wrapper around scipy.spatial.transform.Rotation that preserves quaternion component order (scalar-first or vector-first) across from_quat/as_quat. Falls back to a compatibility class on older SciPy versions and offers a RotationScalarFirst helper that defaults to scalar-first quaternions.
  • YawCorrection.py: Computes per-sensor yaw corrections relative to a base IMU. Aligns all sensor quaternions so the base yaw becomes zero while applying optional starting offsets to other sensors, returning corrected quaternions for each sample.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages