Added an example selector. Try it using gtsamExamples :-)

release/4.3a0
Frank Dellaert 2012-06-12 04:46:51 +00:00
parent f1c5b9f5dc
commit 990eca29db
5 changed files with 144 additions and 2 deletions

View File

@ -36,7 +36,7 @@ options.saveDotFiles = false;
%% 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] = VisualISAMInitialize(data,truth,options);
figure(1); cla;
VisualISAMPlot(truth, data, isam, result, options) VisualISAMPlot(truth, data, isam, result, options)
%% Main loop for iSAM: stepping through all poses %% Main loop for iSAM: stepping through all poses

View File

@ -80,7 +80,7 @@ result.print(sprintf('\nFinal result:\n '));
%% Plot results with covariance ellipses %% Plot results with covariance ellipses
marginals = graph.marginals(result); marginals = graph.marginals(result);
figure(1);clf cla
hold on; hold on;
for j=1:size(points,2) for j=1:size(points,2)
P = marginals.marginalCovariance(symbol('l',j)); P = marginals.marginalCovariance(symbol('l',j));

Binary file not shown.

View File

@ -0,0 +1,142 @@
function varargout = gtsamExamples(varargin)
% GTSAMEXAMPLES MATLAB code for gtsamExamples.fig
% GTSAMEXAMPLES, by itself, creates a new GTSAMEXAMPLES or raises the existing
% singleton*.
%
% H = GTSAMEXAMPLES returns the handle to a new GTSAMEXAMPLES or the handle to
% the existing singleton*.
%
% GTSAMEXAMPLES('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GTSAMEXAMPLES.M with the given input arguments.
%
% GTSAMEXAMPLES('Property','Value',...) creates a new GTSAMEXAMPLES or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before gtsamExamples_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to gtsamExamples_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help gtsamExamples
% Last Modified by GUIDE v2.5 12-Jun-2012 00:27:03
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @gtsamExamples_OpeningFcn, ...
'gui_OutputFcn', @gtsamExamples_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before gtsamExamples is made visible.
function gtsamExamples_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to gtsamExamples (see VARARGIN)
% Choose default command line output for gtsamExamples
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% This sets up the initial plot - only do when we are invisible
% so window can get raised using gtsamExamples.
if strcmp(get(hObject,'Visible'),'off')
plot(rand(5));
end
% --- Outputs from this function are returned to the command line.
function varargout = gtsamExamples_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --------------------------------------------------------------------
function CloseMenuItem_Callback(hObject, eventdata, handles)
% hObject handle to CloseMenuItem (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
selection = questdlg(['Close ' get(handles.figure1,'Name') '?'],...
['Close ' get(handles.figure1,'Name') '...'],...
'Yes','No','Yes');
if strcmp(selection,'No')
return;
end
delete(handles.figure1)
% --- Executes on button press in Odometry.
function Odometry_Callback(hObject, eventdata, handles)
axes(handles.axes3);
echo on
OdometryExample;
echo off
% --- Executes on button press in Localization.
function Localization_Callback(hObject, eventdata, handles)
fprintf(1,'LocalizationExample not implemented yet\n');
% --- Executes on button press in Pose2SLAM.
function Pose2SLAM_Callback(hObject, eventdata, handles)
axes(handles.axes3);
echo on
Pose2SLAMExample
echo off
% --- Executes on button press in Pose3SLAM.
function Pose3SLAM_Callback(hObject, eventdata, handles)
axes(handles.axes3);
echo on
Pose3SLAMExample
echo off
% --- Executes on button press in PlanarSLAM.
function PlanarSLAM_Callback(hObject, eventdata, handles)
axes(handles.axes3);
echo on
PlanarSLAMExample
echo off
% --- Executes on button press in VisualSLAM.
function VisualSLAM_Callback(hObject, eventdata, handles)
axes(handles.axes3);
echo on
VisualSLAMExample
echo off
% --- Executes on button press in VisualISAM.
function VisualISAM_Callback(hObject, eventdata, handles)
axes(handles.axes3);
echo on
VisualISAMExample
echo off
% --- Executes on button press in StereoVO.
function StereoVO_Callback(hObject, eventdata, handles)
fprintf(1,'StereoVOExample not implemented yet\n');
% --- Executes on button press in Future.
function Future_Callback(hObject, eventdata, handles)
fprintf(1,'Future demo not implemented yet :-)\n');