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();
}
}