Moved utility functions that are example-specific to a 'support' namespace inside the examples folder
parent
1b935dbdc5
commit
cceebbf41c
|
@ -16,10 +16,8 @@ install(FILES ${matlab_tests} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam_te
|
||||||
# Examples
|
# Examples
|
||||||
message(STATUS "Installing Matlab Toolbox Examples")
|
message(STATUS "Installing Matlab Toolbox Examples")
|
||||||
# Matlab files: *.m and *.fig
|
# Matlab files: *.m and *.fig
|
||||||
file(GLOB matlab_examples_m "${GTSAM_SOURCE_ROOT_DIR}/matlab/examples/*.m")
|
install(DIRECTORY "${GTSAM_SOURCE_ROOT_DIR}/matlab/examples/" DESTINATION "${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam_examples" FILES_MATCHING PATTERN "*.m")
|
||||||
file(GLOB matlab_examples_fig "${GTSAM_SOURCE_ROOT_DIR}/matlab/examples/*.fig")
|
install(DIRECTORY "${GTSAM_SOURCE_ROOT_DIR}/matlab/examples/" DESTINATION "${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam_examples" FILES_MATCHING PATTERN "*.fig")
|
||||||
set(matlab_examples ${matlab_examples_m} ${matlab_examples_fig})
|
|
||||||
install(FILES ${matlab_examples} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam_examples)
|
|
||||||
|
|
||||||
message(STATUS "Installing Matlab Toolbox Examples (Data)")
|
message(STATUS "Installing Matlab Toolbox Examples (Data)")
|
||||||
# Data files: *.graph and *.txt
|
# Data files: *.graph and *.txt
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,8 @@ isam = visualSLAM.ISAM(options.reorderInterval);
|
||||||
%% Set Noise parameters
|
%% Set Noise parameters
|
||||||
import gtsam.*
|
import gtsam.*
|
||||||
noiseModels.pose = noiseModel.Diagonal.Sigmas([0.001 0.001 0.001 0.1 0.1 0.1]');
|
noiseModels.pose = noiseModel.Diagonal.Sigmas([0.001 0.001 0.001 0.1 0.1 0.1]');
|
||||||
noiseModels.odometry = noiseModel.Diagonal.Sigmas([0.001 0.001 0.001 0.1 0.1 0.1]');
|
%noiseModels.odometry = noiseModel.Diagonal.Sigmas([0.001 0.001 0.001 0.1 0.1 0.1]');
|
||||||
|
noiseModels.odometry = noiseModel.Diagonal.Sigmas([0.1 0.1 0.1 1.0 1.0 1.0]');
|
||||||
noiseModels.point = noiseModel.Isotropic.Sigma(3, 0.1);
|
noiseModels.point = noiseModel.Isotropic.Sigma(3, 0.1);
|
||||||
noiseModels.measurement = noiseModel.Isotropic.Sigma(2, 1.0);
|
noiseModels.measurement = noiseModel.Isotropic.Sigma(2, 1.0);
|
||||||
|
|
|
@ -3,8 +3,8 @@ function datafile = findExampleDataFile(datasetName)
|
||||||
|
|
||||||
[ myPath, ~, ~ ] = fileparts(mfilename('fullpath'));
|
[ myPath, ~, ~ ] = fileparts(mfilename('fullpath'));
|
||||||
searchPath = { ...
|
searchPath = { ...
|
||||||
fullfile(myPath, [ '../../examples/Data/' datasetName ]) ...
|
fullfile(myPath, [ '../../../examples/Data/' datasetName ]) ...
|
||||||
fullfile(myPath, [ 'Data/' datasetName ]) };
|
fullfile(myPath, [ '../Data/' datasetName ]) };
|
||||||
datafile = [];
|
datafile = [];
|
||||||
for path = searchPath
|
for path = searchPath
|
||||||
if exist(path{:}, 'file')
|
if exist(path{:}, 'file')
|
|
@ -11,7 +11,7 @@
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
%% Find data file
|
%% Find data file
|
||||||
datafile = findExampleDataFile('w100-odom.graph');
|
datafile = support.findExampleDataFile('w100-odom.graph');
|
||||||
|
|
||||||
%% Initialize graph, initial estimate, and odometry noise
|
%% Initialize graph, initial estimate, and odometry noise
|
||||||
import gtsam.*
|
import gtsam.*
|
||||||
|
|
|
@ -16,7 +16,7 @@ N = 2500;
|
||||||
% dataset = 'sphere2500_groundtruth.txt';
|
% dataset = 'sphere2500_groundtruth.txt';
|
||||||
dataset = 'sphere2500.txt';
|
dataset = 'sphere2500.txt';
|
||||||
|
|
||||||
datafile = findExampleDataFile(dataset);
|
datafile = support.findExampleDataFile(dataset);
|
||||||
|
|
||||||
%% Initialize graph, initial estimate, and odometry noise
|
%% Initialize graph, initial estimate, and odometry noise
|
||||||
import gtsam.*
|
import gtsam.*
|
||||||
|
|
|
@ -22,7 +22,7 @@ options.nrCameras = 10;
|
||||||
options.showImages = false;
|
options.showImages = false;
|
||||||
|
|
||||||
%% Generate data
|
%% Generate data
|
||||||
[data,truth] = VisualISAMGenerateData(options);
|
[data,truth] = support.VisualISAMGenerateData(options);
|
||||||
|
|
||||||
measurementNoiseSigma = 1.0;
|
measurementNoiseSigma = 1.0;
|
||||||
pointNoiseSigma = 0.1;
|
pointNoiseSigma = 0.1;
|
||||||
|
|
|
@ -32,17 +32,17 @@ options.saveFigures = false;
|
||||||
options.saveDotFiles = false;
|
options.saveDotFiles = false;
|
||||||
|
|
||||||
%% Generate data
|
%% Generate data
|
||||||
[data,truth] = VisualISAMGenerateData(options);
|
[data,truth] = support.VisualISAMGenerateData(options);
|
||||||
|
|
||||||
%% Initialize iSAM with the first pose and points
|
%% Initialize iSAM with the first pose and points
|
||||||
[noiseModels,isam,result] = VisualISAMInitialize(data,truth,options);
|
[noiseModels,isam,result] = support.VisualISAMInitialize(data,truth,options);
|
||||||
cla;
|
cla;
|
||||||
VisualISAMPlot(truth, data, isam, result, options)
|
support.VisualISAMPlot(truth, data, isam, result, options)
|
||||||
|
|
||||||
%% Main loop for iSAM: stepping through all poses
|
%% Main loop for iSAM: stepping through all poses
|
||||||
for frame_i=3:options.nrCameras
|
for frame_i=3:options.nrCameras
|
||||||
[isam,result] = VisualISAMStep(data,noiseModels,isam,result,truth,options);
|
[isam,result] = support.VisualISAMStep(data,noiseModels,isam,result,truth,options);
|
||||||
if mod(frame_i,options.drawInterval)==0
|
if mod(frame_i,options.drawInterval)==0
|
||||||
VisualISAMPlot(truth, data, isam, result, options)
|
support.VisualISAMPlot(truth, data, isam, result, options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Binary file not shown.
|
@ -230,12 +230,12 @@ global frame_i truth data noiseModels isam result options
|
||||||
initOptions(handles)
|
initOptions(handles)
|
||||||
|
|
||||||
% Generate Data
|
% Generate Data
|
||||||
[data,truth] = VisualISAMGenerateData(options);
|
[data,truth] = support.VisualISAMGenerateData(options);
|
||||||
|
|
||||||
% Initialize and plot
|
% Initialize and plot
|
||||||
[noiseModels,isam,result] = VisualISAMInitialize(data,truth,options);
|
[noiseModels,isam,result] = support.VisualISAMInitialize(data,truth,options);
|
||||||
cla
|
cla
|
||||||
VisualISAMPlot(truth, data, isam, result, options)
|
support.VisualISAMPlot(truth, data, isam, result, options)
|
||||||
frame_i = 2;
|
frame_i = 2;
|
||||||
showFramei(hObject, handles)
|
showFramei(hObject, handles)
|
||||||
|
|
||||||
|
@ -246,10 +246,10 @@ global frame_i truth data noiseModels isam result options
|
||||||
while (frame_i<size(truth.cameras,2))
|
while (frame_i<size(truth.cameras,2))
|
||||||
frame_i = frame_i+1;
|
frame_i = frame_i+1;
|
||||||
showFramei(hObject, handles)
|
showFramei(hObject, handles)
|
||||||
[isam,result] = VisualISAMStep(data,noiseModels,isam,result,truth,options);
|
[isam,result] = support.VisualISAMStep(data,noiseModels,isam,result,truth,options);
|
||||||
if mod(frame_i,options.drawInterval)==0
|
if mod(frame_i,options.drawInterval)==0
|
||||||
showWaiting(handles, 'Computing marginals...');
|
showWaiting(handles, 'Computing marginals...');
|
||||||
VisualISAMPlot(truth, data, isam, result, options)
|
support.VisualISAMPlot(truth, data, isam, result, options)
|
||||||
showWaiting(handles, '');
|
showWaiting(handles, '');
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -261,8 +261,8 @@ global frame_i truth data noiseModels isam result options
|
||||||
if (frame_i<size(truth.cameras,2))
|
if (frame_i<size(truth.cameras,2))
|
||||||
frame_i = frame_i+1;
|
frame_i = frame_i+1;
|
||||||
showFramei(hObject, handles)
|
showFramei(hObject, handles)
|
||||||
[isam,result] = VisualISAMStep(data,noiseModels,isam,result,truth,options);
|
[isam,result] = support.VisualISAMStep(data,noiseModels,isam,result,truth,options);
|
||||||
showWaiting(handles, 'Computing marginals...');
|
showWaiting(handles, 'Computing marginals...');
|
||||||
VisualISAMPlot(truth, data, isam, result, options)
|
support.VisualISAMPlot(truth, data, isam, result, options)
|
||||||
showWaiting(handles, '');
|
showWaiting(handles, '');
|
||||||
end
|
end
|
Loading…
Reference in New Issue