-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static GUI for Simulink and add gearboxes inertia (#42)
Static GUI for Simulink and add gearboxes inertia
- Loading branch information
1 parent
525d7ce
commit 88dfec5
Showing
130 changed files
with
10,187 additions
and
70,487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
%% startup.m | ||
% | ||
% Run this script only once to permanently add the matlab-wbc folder to your MATLAB path. | ||
|
||
fprintf('\n## whole-body-controllers ##\n'); | ||
fprintf('\nAdding "matlab-wbc" to pathdef.m...\n\n'); | ||
|
||
% path to whole-body-controllers | ||
pathToWBC = pwd; | ||
pathToWBC = pathToWBC(1:end-6); | ||
|
||
% path to the matlab-wbc library | ||
pathToLibrary = [pathToWBC, filesep, 'library/matlab-wbc']; | ||
|
||
if exist(pathToLibrary, 'dir') | ||
|
||
addpath(pathToLibrary); | ||
else | ||
error('Path to the "matlab-wbc" library not found or not correct.') | ||
end | ||
|
||
% Path to the Matlab userpath | ||
pathToUserpath = userpath; | ||
pathSeparatorLocation = strfind(pathToUserpath, pathsep); | ||
|
||
if isempty(pathToUserpath) | ||
|
||
answer = input('Empty userpath. Do you want to reset the userpath? Y/N ','s'); | ||
|
||
if strcmpi(answer,'Y') | ||
|
||
userpath('reset'); | ||
disp('Resetting userpath..'); | ||
pathToUserpath = userpath; | ||
pathSeparatorLocation = strfind(pathToUserpath, pathsep); | ||
else | ||
error('Please set the userpath before running this script'); | ||
end | ||
|
||
elseif size(pathSeparatorLocation, 2) > 1 | ||
|
||
answer = input('Multiple userpath. Do you want to reset the userpath? Y/N ','s'); | ||
|
||
if strcmpi(answer,'Y') | ||
|
||
userpath('reset'); | ||
disp('Resetting userpath..'); | ||
pathToUserpath = userpath; | ||
pathSeparatorLocation = strfind(pathToUserpath, pathsep); | ||
else | ||
error('Please set a single userpath before running this script'); | ||
end | ||
end | ||
|
||
% check again the userpath | ||
if isempty(pathToUserpath) | ||
|
||
error('userpath is still empty. Please set the userpath before running this script'); | ||
|
||
elseif size(pathSeparatorLocation, 2) > 1 | ||
|
||
error('There are still multiple userpath. Please set a single userpath before running this script'); | ||
end | ||
|
||
if (~isempty(pathSeparatorLocation)) | ||
|
||
pathToUserpath(pathSeparatorLocation) = []; | ||
end | ||
|
||
fprintf('Saving paths to %s\n\n', [pathToUserpath, filesep, 'pathdef.m']); | ||
|
||
if (~savepath([pathToUserpath, filesep, 'pathdef.m'])) | ||
|
||
fprintf(['A file called pathdef.m has been created in your %s folder.\n', ... | ||
'This should be enough to permanently add matlab-wbc to ', ... | ||
'your MATLAB installation.\n'], pathToUserpath); | ||
else | ||
disp('There was an error generating the pathdef.m. Please manually add the matlab-wbc folder to your matlabpath'); | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.