How to measure GAIT ANALYSIS with MPU9250 and Arduino

Hi, I am a Noob so sorry beforehand.

Now, I have a Project at hand where I have to get the walking distance and pattern of the steps of a person accurately (within few inches). I am using Arduino Uno and MPU9250. The library I am using GitHub - hideakitai/MPU9250: Arduino library for MPU9250 Nine-Axis (Gyro + Accelerometer + Compass) MEMS MotionTracking™ Device is the updated version of the kriswiner's library GitHub - kriswiner/MPU9250: Arduino sketches for MPU9250 9DoF with AHRS sensor fusion

After tweaking and modifying the example code, I am able to get the Roll, Yaw, Pitch and able to visualize it. But after that I don't know how to use the sensor to get the distance measured for each step.

I have tried looking for different solutions and tried to understand how to get the accelerometer data to measure the distance, but I am yet to get a solution. Please help.

The basic code:

void setup()
{
    Serial.begin(115200);

    Wire.begin();

    delay(2000);
    mpu.setup();
}

void loop()
{
    static uint32_t prev_ms = millis();
    if ((millis() - prev_ms) > 16)
    {
        mpu.update();
        mpu.print();

        Serial.print("roll  (x-forward (north)) : ");
        Serial.println(mpu.getRoll());
        Serial.print("pitch (y-right (east))    : ");
        Serial.println(mpu.getPitch());
        Serial.print("yaw   (z-down (down))     : ");
        Serial.println(mpu.getYaw());

        prev_ms = millis();
    }
}

If you had a measured velocity for some amount of time would you be able to determine distance travelled?

the walking distance and pattern of the steps of a person accurately (within few inches)

Very difficult to do accurately. See this brief overview from research of a few years back: Gait tracking with x-IMU – x-io Technologies

1 Like

Did you have any progress? I'm working on gait with multiple mpu 9250
X-io code help a lot, but i have problems with filter cutoff and calculation