Improve debug mode.
parent
17e1b60537
commit
a5ccc7aa5b
|
@ -1,6 +1,11 @@
|
|||
debug = true;
|
||||
|
||||
source_dir = getenv('source_root');
|
||||
if debug
|
||||
source_dir = fileparts(mfilename('fullpath'));
|
||||
source_dir = sprintf('%s/../../../', source_dir)
|
||||
else
|
||||
source_dir = getenv('source_root');
|
||||
end
|
||||
|
||||
mex_path = [source_dir filesep 'build-matlab'];
|
||||
addpath(mex_path);
|
||||
|
@ -40,36 +45,36 @@ Experience.kalman_filter_matlab = kalman_filter_matlab;
|
|||
Experience.kalman_filter_mex = kalman_filter_mex;
|
||||
|
||||
try
|
||||
flag = compare_kalman_mex(Experience);
|
||||
if (flag)
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('MEX and MATLAB Kalman filters lead to different results')
|
||||
end
|
||||
end
|
||||
flag = compare_kalman_mex(Experience);
|
||||
if (flag)
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('MEX and MATLAB Kalman filters lead to different results')
|
||||
end
|
||||
end
|
||||
catch
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('Comparison between MEX and MATLAB Kalman filters failed')
|
||||
end
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('Comparison between MEX and MATLAB Kalman filters failed')
|
||||
end
|
||||
end
|
||||
|
||||
dprintf('Test 2: measurement error with diagonal variance-covariance matrix')
|
||||
Experience.MeasurementErrors = 1;
|
||||
|
||||
try
|
||||
flag = compare_kalman_mex(Experience);
|
||||
if (flag)
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('MEX and MATLAB Kalman filters lead to different results')
|
||||
end
|
||||
end
|
||||
flag = compare_kalman_mex(Experience);
|
||||
if (flag)
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('MEX and MATLAB Kalman filters lead to different results')
|
||||
end
|
||||
end
|
||||
catch
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('Comparison between MEX and MATLAB Kalman filters failed')
|
||||
end
|
||||
testFailed = testFailed+1;
|
||||
if debug
|
||||
dprintf('Comparison between MEX and MATLAB Kalman filters failed')
|
||||
end
|
||||
end
|
||||
|
||||
dprintf('Test 3: measurement error with general variance-covariance matrix')
|
||||
|
@ -98,4 +103,6 @@ t1 = clock;
|
|||
|
||||
fprintf('\n*** Elapsed time (in seconds): %.1f\n\n', etime(t1, t0));
|
||||
|
||||
quit(testFailed > 0)
|
||||
if ~debug
|
||||
quit(testFailed > 0)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue