diff --git a/matlab/examples/VO_Example.m b/matlab/examples/StereoVOExample_large.m similarity index 100% rename from matlab/examples/VO_Example.m rename to matlab/examples/StereoVOExample_large.m diff --git a/matlab/examples/VisualISAMExample.m b/matlab/examples/VisualISAMExample.m index 2dfde60bb..f8423a057 100644 --- a/matlab/examples/VisualISAMExample.m +++ b/matlab/examples/VisualISAMExample.m @@ -36,7 +36,7 @@ options.saveDotFiles = false; %% Initialize iSAM with the first pose and points [noiseModels,isam,result] = VisualISAMInitialize(data,truth,options); -figure(1); +cla; VisualISAMPlot(truth, data, isam, result, options) %% Main loop for iSAM: stepping through all poses diff --git a/matlab/examples/VisualSLAMExample.m b/matlab/examples/VisualSLAMExample.m index f6ef2063b..c2b045dab 100644 --- a/matlab/examples/VisualSLAMExample.m +++ b/matlab/examples/VisualSLAMExample.m @@ -80,7 +80,7 @@ result.print(sprintf('\nFinal result:\n ')); %% Plot results with covariance ellipses marginals = graph.marginals(result); -figure(1);clf +cla hold on; for j=1:size(points,2) P = marginals.marginalCovariance(symbol('l',j)); diff --git a/matlab/examples/gtsamExamples.fig b/matlab/examples/gtsamExamples.fig new file mode 100644 index 000000000..39370f3df Binary files /dev/null and b/matlab/examples/gtsamExamples.fig differ diff --git a/matlab/examples/gtsamExamples.m b/matlab/examples/gtsamExamples.m new file mode 100644 index 000000000..4f6cb525c --- /dev/null +++ b/matlab/examples/gtsamExamples.m @@ -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');