Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gps-modeling
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martina Maggio
gps-modeling
Commits
6e6be874
Commit
6e6be874
authored
Feb 27, 2019
by
Claudio Mandrioli
Browse files
Options
Downloads
Patches
Plain Diff
polished and modified trade off experiments script for car so that it uses the plotting script
parent
700ab23a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
matlab/plot_tradeoff.m
+1
-1
1 addition, 1 deletion
matlab/plot_tradeoff.m
matlab/run_many_car.m
+17
-28
17 additions, 28 deletions
matlab/run_many_car.m
matlab/run_many_cycling.m
+3
-3
3 additions, 3 deletions
matlab/run_many_cycling.m
with
21 additions
and
32 deletions
matlab/plot_tradeoff.m
+
1
−
1
View file @
6e6be874
...
@@ -6,7 +6,7 @@ figure
...
@@ -6,7 +6,7 @@ figure
hold
on
hold
on
xlabel
(
'energy'
)
xlabel
(
'energy'
)
ylabel
(
'error'
)
ylabel
(
'error'
)
title
(
'
cycling
energy accuracy tracking trade-off'
)
title
(
'energy accuracy tracking trade-off'
)
grid
grid
%iterate and plot the results for the different P thresholds
%iterate and plot the results for the different P thresholds
for
j
=
1
:
length
(
P_treshold
)
for
j
=
1
:
length
(
P_treshold
)
...
...
This diff is collapsed.
Click to expand it.
matlab/run_many_car.m
+
17
−
28
View file @
6e6be874
%"monteCarlo" example
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Script for example of energy-accuracy trade-off evaluatio with the
% car trace
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Load data
%% Load data
disp
(
'Loads data'
)
disp
(
'Loads data'
)
load
(
'
GNSSaidedINS
_data.mat'
);
load
(
'
car_input
_data.mat'
);
%% Load filter settings
%% Load filter settings
disp
(
'Loads settings'
)
disp
(
'Loads settings'
)
settings
=
get_settings_car
();
settings
=
get_settings_car
();
%vector of RGB colors for plotting for the different P references
%% Settings for tradeoff evaluation
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
%vector of refrences for P
P_treshold
=
[
4.0
,
5.0
,
6.0
,
8.0
,
10.0
,
12.0
];
P_treshold
=
[
4.0
];
%
,5.0,6.0,8.0,10.0,12.0];
%number of runs per each P
%number of runs per each P
n_run
=
1
;
n_run
=
1
;
%allocate memory for output
%allocate memory for output
energy
=
zeros
(
n_run
,
length
(
P_treshold
));
energy
=
zeros
(
n_run
,
length
(
P_treshold
));
error
=
zeros
(
n_run
,
length
(
P_treshold
));
error
=
zeros
(
n_run
,
length
(
P_treshold
));
%% Iterate over the different thresholds for tr(P)
for
j
=
1
:
length
(
P_treshold
)
for
j
=
1
:
length
(
P_treshold
)
%set P reference
disp
([
'Starting simulations with threshold for P equal to:'
,
num2str
(
P_treshold
(
j
))])
%display reached treshold
settings
.
P_treshold
=
P_treshold
(
j
);
settings
.
P_treshold
=
P_treshold
(
j
);
%run simulations
for
k
=
1
:
n_run
%iterate over the number of simulations per threshold
for
k
=
1
:
n_run
disp
([
'Simulation number:'
,
num2str
(
k
)])
%display simulation number
%% Run the GNSS-aided INS
out_data
=
GPSaidedINS_car
(
in_data
,
settings
);
% Run the GNSS-aided INS
disp
(
'Running the GNSS-aided INS'
)
energy
(
k
,
j
)
=
out_data
.
energy
;
% store energy
P_treshold
(
j
)
error
(
k
,
j
)
=
out_data
.
error
;
% store positioning error
k
out_data
=
GPSaidedINS
(
in_data
,
settings
);
energy
(
k
,
j
)
=
out_data
.
energy
;
error
(
k
,
j
)
=
out_data
.
error
;
end
end
end
end
%% Plot results
%plot data
disp
(
'Plot results'
)
disp
(
'Plotting data:'
)
plot_tradeoff
figure
\ No newline at end of file
hold
on
xlabel
(
'energy'
)
ylabel
(
'error'
)
title
(
'car energy accuracy tracking trade-off'
)
grid
for
j
=
1
:
length
(
P_treshold
)
scatter
(
energy
(:,
j
),
error
(:,
j
),
20
,
color
(
j
,:),
'o'
,
'filled'
)
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
matlab/run_many_cycling.m
+
3
−
3
View file @
6e6be874
...
@@ -13,14 +13,14 @@ settings=get_settings_cycling();
...
@@ -13,14 +13,14 @@ settings=get_settings_cycling();
%% Settings for tradeoff evaluation
%% Settings for tradeoff evaluation
%vector of refrences for P
%vector of refrences for P
P_treshold
=
[
4.0
,
5.0
];
%
,6.0,8.0,10.0,12.0];
P_treshold
=
[
4.0
,
5.0
,
6.0
,
8.0
,
10.0
,
12.0
];
%nubmer of simulations per each P
%nubmer of simulations per each P
n_run
=
1
;
n_run
=
50
;
%allocate memory for output
%allocate memory for output
energy
=
zeros
(
n_run
,
length
(
P_treshold
));
energy
=
zeros
(
n_run
,
length
(
P_treshold
));
error
=
zeros
(
n_run
,
length
(
P_treshold
));
error
=
zeros
(
n_run
,
length
(
P_treshold
));
%% Iterate over the threshold for tr(P)
%% Iterate over the
different
threshold
s
for tr(P)
for
j
=
1
:
length
(
P_treshold
)
for
j
=
1
:
length
(
P_treshold
)
disp
([
'Starting simulations with threshold for P equal to:'
,
num2str
(
P_treshold
(
j
))])
%display reached treshold
disp
([
'Starting simulations with threshold for P equal to:'
,
num2str
(
P_treshold
(
j
))])
%display reached treshold
settings
.
P_treshold
=
P_treshold
(
j
);
%set P reference
settings
.
P_treshold
=
P_treshold
(
j
);
%set P reference
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment