Gait-Tracking-With-x-IMU icon indicating copy to clipboard operation
Gait-Tracking-With-x-IMU copied to clipboard

Can we use this for tracking a UAV trajectory using the flight controllers IMU?

Open ahmednawazkhan opened this issue 6 years ago • 8 comments

Hi. thank you for the code. It is extremely use full for learning. I was wondering if I can use this code to estimate my UAV flight trajectory using same IMU readings from the Flight controller of UAV.

ahmednawazkhan avatar Feb 21 '19 14:02 ahmednawazkhan

The gait tracking code is for tracking the motion of a foot during walking. The code cannot be used to track a UAV.

xioTechnologies avatar Feb 28 '19 14:02 xioTechnologies

and why is that sir?

ahmednawazkhan avatar Mar 04 '19 08:03 ahmednawazkhan

In my opinion it's possible. Gait-Tracking-With-x-IMU is nothing else than inertial navigation system. Probably you can use this code to estimate the relative position from your current position.

rolba avatar Mar 04 '19 09:03 rolba

This is what I believe too. but inside the code script.m the data is split into chunks. may be it is kind of taking average or something for accuracy and hence requires a large amount of data. how can I deal with that?

ahmednawazkhan avatar Mar 04 '19 10:03 ahmednawazkhan

Where exactly do you see that?

rolba avatar Mar 04 '19 12:03 rolba

The tracking relies on the sensor being stationary at the end of each foot stride, e.g. every 1 second. These frequent stationary periods are essential to compensate for drift the in calculated velocity.

xioTechnologies avatar Mar 04 '19 17:03 xioTechnologies

surely i would like to ignore this drift error correction and try to approximate the trajectory from this since i have found no other free software that enable me produce my UAV flight trajectory. So i think I can ignore this drift error correction?

ahmednawazkhan avatar Mar 04 '19 17:03 ahmednawazkhan

@rolba here is the part which seems to split data

% Initial convergence
initPeriod = 2;
indexSel = 1 : find(sign(time-(time(1)+initPeriod))+1, 1);
for i = 1:2000
    AHRSalgorithm.UpdateIMU([0 0 0], [mean(accX(indexSel)) mean(accY(indexSel)) mean(accZ(indexSel))]);
end

i am not getting this part at all :)

% For all data
for t = 1:length(time)
    if(stationary(t))
        AHRSalgorithm.Kp = 0.5;
    else
        AHRSalgorithm.Kp = 0;
    end
    AHRSalgorithm.UpdateIMU(deg2rad([gyrX(t) gyrY(t) gyrZ(t)]), [accX(t) accY(t) accZ(t)]);
    quat(t,:) = AHRSalgorithm.Quaternion;
end

ahmednawazkhan avatar Mar 04 '19 17:03 ahmednawazkhan