Select Git revision
throttle_drv.h
Forked from
Anders Blomdell / LabComm
Source project has a limited visibility.
run_many_cycling.m 1.10 KiB
%"monteCarlo" example
%% Load data
disp('Loads data')
load('cycling_input_data');
%% Load filter settings
disp('Loads settings')
settings=get_settings_cycling();
%vector of RGB colors for plotting for the different P references
color=[[0.7,0.0,0.0];[0.0,0.7,0.0];[0.7,0.0,0.7];[0.0,0.0,0.7];[0.0,0.7,0.7];[0.7,0.7,0.0]];
%vector of refrences for P
P_treshold=[4.0,5.0,6.0,8.0,10.0,12.0];
%nubmer of runs per each P
n_run=30;
%allocate memory for output
energy=zeros(n_run,length(P_treshold));
error=zeros(n_run,length(P_treshold));
for j=1:length(P_treshold)
%set P reference
settings.P_treshold=P_treshold(j);
%run simulations
for k=1:n_run
%% Run the GNSS-aided INS
disp('Running the GNSS-aided INS')
P_treshold(j)
k
out_data=GPSaidedINS_cycling(in_data,settings);
energy(k,j)=out_data.energy;
error(k,j)=out_data.error;
end
end
%plot data
figure
hold on
xlabel('energy')
ylabel('error')
title('cycling energy accuracy tracking trade-off')
grid
for j=1:length(P_treshold)
scatter(energy(:,j), error(:,j),20,color(j,:),'o','filled')
end