Skip to content
Snippets Groups Projects
Commit daf6f322 authored by Wouda, Frank (UT-EEMCS)'s avatar Wouda, Frank (UT-EEMCS)
Browse files

Added README.md, fixed a bug with orientation estimation, added examples.

parent b156b47e
No related branches found
No related tags found
No related merge requests found
......@@ -14,11 +14,11 @@ unitRotMat=eye(3);
indexes = data.tMiddle(index):data.tMiddle(index+1);
% Rotate the gyroscope data to Foot-frame.
gyroLocal = (calibration.rotMatrix*data.filtGyr(indexes,:)');
gyroLocal = (calibration.rotMatrix*data.filtGyr(indexes,:)')';
% Integrate the signals from this orientation, such that everything is
% mapped in that frame.
rotMatHat = math.intOmega(unitRotMat,gyroLocal',1/data.fs);
rotMatHat = math.intOmega(unitRotMat,gyroLocal,data.fs);
accLocal = (calibration.rotMatrix*data.filtAcc(indexes,:)')';
......
function rotMat = intOmega(initRotMat, omega, ts)
function rotMat = intOmega(initRotMat, omega, fs)
% intOmega.m - Calculates orientation matrix by integrating gyroscope signal
%
% Inputs:
% initRotMat Initial orientation matrix
% omega Angular velocity (rad/s)
% ts Sample time
% fs Sample frequency
%
% Outputs:
% rotMat Orientation matrix [Nsamples x 3 x 3]
......@@ -29,7 +29,7 @@ for i=2:N
R = permute(rotMat(i-1, :, :),[2 3 1]);
Rdot = R*permute(omegaMatrix(i,:,:),[2 3 1]); % Integrate R
R = R + ts.*Rdot;
R = R + (1/fs).*Rdot;
[A,~]=qr(R); % create proper rotation matrix
rotMat(i,:,:) = sqrt(A.*A).*sign(R); % get correct sign
......
# Foot progression angle estimation
Uses csv files from Movella DOT exporter to calculate foot progression angles assuming that you provide one calibration trial, see for details also the [publication](https://doi.org/10.1186/s12984-021-00816-4).
The calibration trial should be performed with close to 0 degrees of FPA.
The example files include:
- calibration
- toe-in walking
- toe-out walking
Be aware that `settingsFile.m` refers to the data path to use. When specified just run `main.m` to obtain a structure with the processed files.
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -16,7 +16,7 @@ function dataStruct = getCalibration(filePath, fCutOff)
% Get the current file path and trial name.
currFilePath = [calibFiles(i).folder '\' calibFiles(i).name];
trialName = ['trial_' strrep(extractBefore(calibFiles(i).name, '.csv'),' ', '_')];
trialName = [extractBefore(calibFiles(i).name, '.csv')];
% Load in the actual Movella Dot CSV file.
dataStruct.(trialName) = readDotCsv(currFilePath);
......
......@@ -10,7 +10,7 @@ function dataStruct = readDotCsv(filePath)
% Store the data in a useable format.
dataStruct.acc = table2array(currentData(:,{'Acc_X', 'Acc_Y', 'Acc_Z'}));
dataStruct.gyr = table2array(currentData(:,{'Gyr_X', 'Gyr_Y', 'Gyr_Z'}));
dataStruct.gyr = table2array(currentData(:,{'Gyr_X', 'Gyr_Y', 'Gyr_Z'}))*pi/180;
dataStruct.mag = table2array(currentData(:,{'Mag_X', 'Mag_Y', 'Mag_Z'}));
dataStruct.time = table2array(currentData(:,'SampleTimeFine')- ...
currentData(1,'SampleTimeFine'))/1000000;
......
%% This file contains all the required settings.
% Specify the main direction for the subject data files.
fileFolder = "C:\Measurements\FPA-measurements\Subject2";
fileFolder = "C:\Measurements\20230912 - FPA";
% Specify where the calibration folder is, has to be placed inside the
% subject folder.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment