Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real Time System. Speed correction #44

Open
egor-yurchenko opened this issue Dec 19, 2022 · 2 comments
Open

Real Time System. Speed correction #44

egor-yurchenko opened this issue Dec 19, 2022 · 2 comments

Comments

@egor-yurchenko
Copy link

Hello, I am trying to implement this algorithm in real time. Faced the problem of speed correction. How can I calculate speed drift in real time? Or do I need to use a different algorithm or approach?

This implementation will not work in realtime:

velDrift = zeros(size(vel));
stationaryStart = find([0; diff(stationary)] == -1);
stationaryEnd = find([0; diff(stationary)] == 1);
for i = 1:numel(stationaryEnd)
driftRate = vel(stationaryEnd(i)-1, :) / (stationaryEnd(i) - stationaryStart(i));
enum = 1:(stationaryEnd(i) - stationaryStart(i));
drift = [enum'*driftRate(1) enum'*driftRate(2) enum'*driftRate(3)];
velDrift(stationaryStart(i):stationaryEnd(i)-1, :) = drift;
end

@xioTechnologies
Copy link
Owner

xioTechnologies commented Dec 19, 2022

A real time implementation must have a latency of one stride to allow for the velocity drift correction. I suggest you work with the more recent, Python implementation as the code is simpler.

@egor-yurchenko
Copy link
Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants