Gait-Tracking icon indicating copy to clipboard operation
Gait-Tracking copied to clipboard

data conversion

Open SimoneCaiati opened this issue 1 year ago • 13 comments

Hi! I'm trying to use the algorithm, and i noticed that for its use i've to use measurements that are in G and deg/s. Since I have m/s^2 and rad/s, is it okay if I convert them here and like this?

def process_sensor_data(self): self.delta_time = np.diff(self.timestamp, prepend=self.timestamp[0]) self.euler = np.empty((len(self.timestamp), 3)) self.internal_states = np.empty((len(self.timestamp), 3)) self.acceleration = np.empty((len(self.timestamp), 3))

for index in range(len(self.timestamp)):
    self.gyroscope[index] = self.gyroscope[index]* (180.0 / math.pi)            #rad/s in deg/s
    self.gyroscope[index] = self.offset.update(self.gyroscope[index])
    self.accelerometer[index]= self.accelerometer[index] / 9.81               #da togliere per short_walk

    self.ahrs.update_no_magnetometer(
        self.gyroscope[index], 
        self.accelerometer[index], 
        self.delta_time[index])

    self.euler[index] = self.ahrs.quaternion.to_euler()

    ahrs_internal_states = self.ahrs.internal_states
    self.internal_states[index] = np.array([
        ahrs_internal_states.acceleration_error,
        ahrs_internal_states.accelerometer_ignored,
        ahrs_internal_states.acceleration_recovery_trigger])

    self.acceleration[index] = 9.81 * self.ahrs.earth_acceleration  # convert g to m/s/s

Also, in one of the closed discussions, I read that this algorithm only works with IMU sensors attached to the foot, and not held in the hand. Did I understand this correctly or did I misunderstand?

SimoneCaiati avatar Jan 20 '25 21:01 SimoneCaiati

There is no issue in converting units. The algorithm only works for an IMU attached to the foot.

xioTechnologies avatar Jan 21 '25 08:01 xioTechnologies

is there a possibility of using it in such a way that it can also accept data from hand-held sensors?

SimoneCaiati avatar Jan 21 '25 11:01 SimoneCaiati

This algorithm only works for an IMU attached to the foot.

xioTechnologies avatar Jan 21 '25 12:01 xioTechnologies

all right, thanks so mutch

SimoneCaiati avatar Jan 21 '25 14:01 SimoneCaiati

what if I found a way to strap the mobile phone to my foot firmly? because it seems that the algorithm works in such a way that it manages the periods of stasis and movement of the foot. If the data are accurate it should be fine, or not?

SimoneCaiati avatar Jan 21 '25 15:01 SimoneCaiati

I am not aware pf anyone testing this with a phone. I expect it would be impractical but it should provide some success. Phone IMUs will provide far less accuracy than the devices we use.

xioTechnologies avatar Jan 21 '25 18:01 xioTechnologies

Hi! I'm testing the algorithm with data collected by mbientlab sensor placed on the foot during walking. I'm experiencing problems with the results obtained. My sensors are sampled at 100Hz, with acceleration in G and gyroscope in deg/s. why am i not getting a result that is faithful to what i expect? from the graphs it would seem that the measurements are taken correctly (i have also analysed them in excel). I pass you one of the excel files with the results obtained; my movement is simply ‘a straight walk for about 3 metres’. I hope you can help me out, thanks in advance.

https://www.dropbox.com/scl/fo/zr4z5mj4of4y6q1eiaxt8/ALLzlIc7CH-HP_yqVkV-Tms?rlkey=qxbnble65qmcgaittg5vbcpa4&st=f2qs5j9g&dl=0

SimoneCaiati avatar Feb 13 '25 12:02 SimoneCaiati

I suggest you share a plot of your data and annotate or describe the issue.

xioTechnologies avatar Feb 13 '25 15:02 xioTechnologies

ok sorry, it works.

SimoneCaiati avatar Feb 13 '25 15:02 SimoneCaiati

This algorithm only works for an IMU attached to the foot.

What facets of the algorithm limit it to the foot?

DWilliamsFF avatar Feb 25 '25 01:02 DWilliamsFF

What facets of the algorithm limit it to the foot?

The IMU must be stationary after each period of movement to reset the drift in the calculated velocity. The period of movement must be very short (e.g. ~1 second), and the stationary periods must be truly stationary. These conditions are typically only true for an IMU attached to the foot.

xioTechnologies avatar Feb 26 '25 07:02 xioTechnologies

What facets of the algorithm limit it to the foot?

The IMU must be stationary after each period of movement to reset the drift in the calculated velocity. The period of movement must be very short (e.g. ~1 second), and the stationary periods must be truly stationary. These conditions are typically only true for an IMU attached to the foot.

That makes a lot of sense. Thanks for clarifying

DWilliamsFF avatar Feb 26 '25 18:02 DWilliamsFF

What facets of the algorithm limit it to the foot?

The IMU must be stationary after each period of movement to reset the drift in the calculated velocity. The period of movement must be very short (e.g. ~1 second), and the stationary periods must be truly stationary. These conditions are typically only true for an IMU attached to the foot.

Thanks for the clarification. I suggest to include this limitation in the main Readme to avoid people pursuing other motion tracking applications that on the surface seem similar.

groundstack avatar Aug 23 '25 07:08 groundstack