-
Notifications
You must be signed in to change notification settings - Fork 42
/
startup_rvc.m
74 lines (64 loc) · 2.12 KB
/
startup_rvc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function startup_rvc
disp('Robotics, Vision & Control: (c) Peter Corke 1992-2019 http://www.petercorke.com')
if verLessThan('matlab', '7.0')
warning('You are running a very old (and unsupported) version of MATLAB. You will very likely encounter significant problems using the toolboxes but you are on your own with this');
end
tb = false;
startup_path = fileparts( mfilename('fullpath') );
[~,folder]=fileparts(startup_path);
if strcmp(folder, 'common')
% startup_rvc is in common folder
rvcpath = fileparts(startup_path);
else
% startup_rvc is in folder above common
rvcpath = startup_path;
end
robotpath = fullfile(rvcpath, 'robot');
if exist(robotpath, 'dir')
addpath(robotpath);
tb = true;
if exist('startup_rtb') == 2
startup_rtb
end
end
visionpath = fullfile(rvcpath, 'vision');
if exist(visionpath, 'dir')
addpath(visionpath);
tb = true;
if exist('startup_mvtb') == 2
startup_mvtb
end
end
if tb
% RTB or MVTB is present
% add spatial math toolbox
p = fullfile(rvcpath, 'smtb');
if exist(p, 'dir')
try
fp = fopen( fullfile(p, 'RELEASE'), 'r');
release = fgetl(fp);
fclose(fp);
catch ME
release = [];
end
if release
release = ['(release ' release ')'];
else
release = '';
end
fprintf('- Spatial Math Toolbox for MATLAB %s\n', release)
addpath(p);
end
% add a top-level simulink folder as created for mltbx installs
p = fullfile(rvcpath, 'simulink');
if exist(p, 'dir')
addpath();
end
% add common files
addpath(fullfile(rvcpath, 'common'));
else
fprintf('Neither Robotics Toolbox or MachineVision Toolbox found in %s\n', rvcpath);
end
% check for any install problems
rvccheck(false)
end