forked from NiryoRobotics/niryo_one_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_trajectory.m
34 lines (28 loc) · 1.21 KB
/
import_trajectory.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
% import_trajectory.m
% Copyright (C) 2018 Niryo
% All rights reserved.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% this function import difference , planned and executed trajectory
% the file imported is .xls file
function [thero_trajectory,real_trajectory,diff_trajectory]=import_trajectory()
[fullFileName]=open_folder();
Trajectories=xlsread(fullFileName);
thero_trajectory=Trajectories(1:7,:);
real_trajectory=Trajectories(8:14,:);
diff_trajectory=Trajectories(15:21,:);
function [fullFileName]=open_folder()
startingFolder = userpath % Or "pwd" or wherever you want.
defaultFileName = fullfile(startingFolder, '*.xls');
[baseFileName, folder] = uigetfile(defaultFileName, 'Specify a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName);