Commit 3ab2b2b7 authored by Claudio Mandrioli's avatar Claudio Mandrioli
Browse files

added test cases for function GPS_aidedINS both car trace and cycling trace

parent afbfe209
......@@ -6,8 +6,8 @@
test_dcm2q
test_get_settings_car
test_get_settings_cycling
% test_gps_randomized_car
% test_gps_randomized_cycling
test_gps_randomized_car
test_gps_randomized_cycling
% test_GPSaidedINS_car
% test_GPSaidedINS_cycling
% test_gravity
......
% test case for function GPSaidedINS_car
%purpose: test that the function runs without errors and outputs the
% correct struct
%oracle: returns a non-empty struct with fields: x_h, delta_u_h, diag_P,
% energy and error
clear all %clear workspace
close all
cd .. %move to functions directory
%initialize input data
load('car_input_data.mat');
settings=get_settings_car();
settings.P_treshold=4.1;
%execute function
out_data=GPSaidedINS_car(in_data,settings);
cd tests %go back to tests directory
%verify output
if ~(isfield(out_data, 'x_h') && ...
isfield(out_data, 'delta_u_h') && ...
isfield(out_data, 'diag_P') && ...
isfield(out_data, 'energy') && ...
isfield(out_data, 'error')...
)
error('error in function GPSaidedINS_car')
else
disp('function GPSaidedINS_car ok')
end
\ No newline at end of file
% test case for function GPSaidedINS_cycling
%purpose: test that the function runs without errors and outputs the
% correct struct
%oracle: returns a non-empty struct with fields: x_h, delta_u_h, diag_P,
% energy and error
clear all %clear workspace
close all
cd .. %move to functions directory
%initialize input data
load('cycling_input_data.mat');
settings=get_settings_cycling();
settings.P_treshold=4.1;
%execute function
out_data=GPSaidedINS_cycling(in_data,settings);
cd tests %go back to tests directory
%verify output
if ~(isfield(out_data, 'x_h') && ...
isfield(out_data, 'delta_u_h') && ...
isfield(out_data, 'diag_P') && ...
isfield(out_data, 'energy') && ...
isfield(out_data, 'error')...
)
error('error in function GPSaidedINS_cycling')
else
disp('function GPSaidedINS_cycling ok')
end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment