GithubHelp home page GithubHelp logo

gait-tracking's Introduction

Gait-Tracking

Tracks the position of an IMU attached to a subject's foot during walking using Python. The algorithm uses Fusion to obtain a measurement of acceleration in the Earth coordinate frame from gyroscope and accelerometer data. The measurement of acceleration is then integrated to obtain a measurement of velocity. The measurement of velocity is corrected for drift using a zero-velocity detection algorithm and then integrated to obtain the measurement of position.

The repository includes two example datasets collected using an NGIMU. In both datasets, the subject walks in a loop so that the foot ends at the same location that it started. The accuracy, evaluated as the final displacement of the foot is 82 mm for a ~25 m walk (short_walk.csv), and 421 mm for a ~60 m walk (long_walk.csv). Animations generated for each dataset are available on YouTube and linked to below.

short_walk.csv
Gait Tracking with IMU in Python (short_walk.csv)
long_walk.csv
Gait Tracking with IMU in Python (long_walk.csv)

gait-tracking's People

Contributors

xiotechnologies avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gait-tracking's Issues

Gait-tracking on the fly

Hi,
the python code seems to be intended for use with a previously recorded dataset in determining how to deal with the moving/non-moving moments of time. Some questions to that:

  1. Do you have a working version for real-time analysis (python or c/c++) ?
  2. the recording and the analysis is done for data at 400Hz. Would it work with data with less resolution (~200Hz) ?
  3. my sensors can do either 400Hz without oversampling, or 200Hz with 2x oversampling, or 100Hz 4x oversampling. With which combination does it make sense to record? (trade-off between number of measurements and low variance)

Thanks

Resolved Questions

Hello!Can you tell me where the "import imufusion" in your code comes from?

Does the gain-tracking algorithm work even if exercising at constant speed?

@xioTechnologies
Hi, Thanks for your great work.
I'm going to do a dead reckoning using IMU in a mobile robot.

For this algorithm, I understand that speed and position are obtained through integration only if there is acceleration.
For constant velocity motion, the acceleration value is very small.

Then can I use this algorithm even in the above situation?
If it's not suitable, do you have any algorithms to recommend in my situation?

I'd appreciate it if you could answer me.
Thanks,

Direction Problem

I have Acceleration data and Gyroscope data with 100Hz. When I am trying to use this, the direction showing is total opposite than the actual direction. Like If I am going in North Direction then it is showing I am going into South Direction. Why is that so??
And what are the parameters I should vary to make it compatible with my sensor(MPU6050 GY-521) ??

Drop on the Z-axis

Hello @xioTechnologies ,

First of all, thank you for your great work on this Gait-Tracking algorithm.
I'm working on an IMU project using the STM32 lsm6dsr sensor, and I'm having issues with dropping over 1 meter on the Z axis (please take a look at the pictures on the links below).
X-Y Plane.png
X-Y-Z Plane.png
Do you have an idea what can be issuing this dropping on the Z-axis, or what I can do to decrease it? The test was made on a flat surface, and it shouldn't be any movement around the Z-axis. I have used data from a gyroscope and accelerometer.

Thank you in advance and best regards,

Dragan

Calclu linear displacement

Hello,

First I would like to thank you for the experiment you did and the information so rewarding.

I am a civil engineering student and I want to use the IMU sensor to determine the displacement of a particle.

I am currently using a WitMotion Bluetooth BLE 5.0 9 Axis WT901BLE sensor.

For the calibration of the sensor, I use the software provided by the company Witmotion.

The recording is done by a frequency of 20 Hz. I try to have first simple displacements, like 30 or 50 cm on the X axis.

I entered my data in your code by changing the frequency, but I still get zero speed and zero displacement.

Can you tell me if this code can work in my case, if so what are the parameters to change?
If not, can you direct me to other codes, or what do you recommend?

Thank you

Gait Tracking with custom data

I want to use my own data from my own IMU. I was wondering how important is it that the timestamps on the 2 sets of sensors match?
Does the code expect an exact sample rate or an average sample rate? (my sensor is able to get an average of 50 hz, but its not perfectly logging every 0.002 seconds)

Module 'imufusion' has no attribute 'CONVENTION_NWU'

Hello, thank you very much for your project which helps me a lot. However I wanted to test your code and I get this error:

AttributeError: module 'imufusion' has no attribute 'CONVENTION_NWU'

I'm sorry if this is a silly question but I'm a beginner. I checked that the latest version of imufusion was installed. I'm working on conda, maybe that's where the problem comes from?

Thanks in advance for your help.

`acceleration_rejection_timer` is removed?

Hello,
Very nice demo
But when I run it, ahrs_internal_states.acceleration_rejection_timer, gives me an error.

Should I replace it with ahrs_internal_states.acceleration_recovery_trigger

a drop in Z-axis

hi,i have met a problem ,When I tested using my own data, there was a deviation of g in the acceleration of the z-axis. How should I eliminate it。
ceaaa8de647aae203b59430321ec43b

about instead data

can i use other devices collect data instead of matlab's data;the way I use it is with a hand-held gyroscope

Can this algorithm used in Android's IMU data

Hi , can this tracking method used in the Android data?

I tryed to get the gyroscope and accelerometer data from Android phone, some data like below

Time (s),Accelerometer X (m/s/s),Accelerometer Y (m/s/s),Accelerometer Z (m/s/s),Gyroscope X (rad/s),Gyroscope Y (rad/s),,Gyroscope Z (rad/s)
0.005 0.16660027 0.07058827 9.853045 -0.0017561859 -0.0018325418 3.8177954E-4 
0.01 0.1689931 0.07537391 9.83151 -5.344914E-4 -0.0012216945 -2.2906772E-4 
0.015 0.17377874 0.0634098 9.836296 -0.0017561859 0.0012216945 -0.0014507623 
0.02 0.14745769 0.058624156 9.8219385 -0.0023670332 0.0 -8.39915E-4 
0.025 0.14027923 0.04426722 9.836296 -5.344914E-4 -0.0018325418 -0.0014507623 
0.030000000000000002 0.14985052 0.032303106 9.81476 -0.0023670332 -0.0012216945 -8.39915E-4 
0.035 0.15702899 0.032303106 9.843474 7.635591E-5 -0.002443389 -8.39915E-4 
0.04 0.15463616 0.051445685 9.802796 -5.344914E-4 -0.0012216945 -2.2906772E-4 
0.045 0.1689931 0.05383851 9.829117 7.635591E-5 -0.0018325418 -2.2906772E-4 

the sample_rate is 200HZ and I changed the data fomat by follow code

sample_rate = 200  # 200 Hz

timestamp = data[:, 0]
gyroscope = data[:, 4:7]*180/math.pi
accelerometer = data[:, 1:4]/9.81

I first stood still for a period of time, then walked around a building with my phone, which was about tens of meters. In the end, the starting and ending positions were basically the same. However, from the calculation results, there was basically no change in the displacement.
image
image

Error: 0.082 m

Hello,
Thanks for sharing your code, I am getting some errors while running your code. For the parameters and data of the code I did not make any changes. But still this error occurs.
"
D:\ProgramData\Anaconda3\envs\labelme\python.exe D:/code/Gait-Tracking/gait_tracking.py
Error: 0.082 m
"
What should I do about it, please?
Thank you.

No imufusion import

The imufusion library in gait_tracking.py is not available. Could you help to fix tt? Thanks so much!

some issues with imufusion settings and other questions

Hello,

I'm using your code to plot a 3D figure of gait tracked with my Arduino MKR IMU shield (BNO055), but I'm encountering some problems. In particular, I believe that the plotted position (in meters) does not match reality.

First of all, I collected 10Hz data for over 60 minutes without filtering the data in my Arduino code. Do I need to filter the data?

The IMU was upside-down, so the z-axis was pointing downwards. I set the NED convention, but do I need to multiply the acceleration by -1?

These are my imufusion settings:
`
``ahrs.settings = imufusion.Settings(imufusion.CONVENTION_NED, 0.8, 2000, 20, 10, 1 * sample_rate)```

And I modified the acceleration threshold as follows:

`is_moving[i] = numpy.sqrt(acceleration[i].dot(acceleration[i])) > 0.55

and the margin :

margin = int(0.1 * sample_rate)

Could you please tell me if I have set the parameters correctly?

Thank you.

Can't import imufusion

hello,

I would like to try out your code howeveer I get the following errror with the importation of imufusion :

import imufusion
ImportError: numpy.core.multiarray failed to import

Did you already encounter this problem or do you have an idea of how to fix it?

Yaw is not right

Hi, thanks for your code!

When I run project with my own data, I find the Yaw has a error compare to real value.

Maybe it will cause the error for gait-tracking

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.