-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdemo_drawData_DS.m
executable file
·54 lines (48 loc) · 2.74 KB
/
demo_drawData_DS.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Demo Script for Drawing Data GMM-based LPV_DS Learning for paper: %
% 'A Physically-Consistent Bayesian Non-Parametric Mixture Model for %
% Dynamical System Learning.' % %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2018 Learning Algorithms and Systems Laboratory, %
% EPFL, Switzerland %
% Author: Nadia Figueroa %
% email: [email protected] %
% website: http://lasa.epfl.ch %
% %
% This work was supported by the EU project Cogimon H2020-ICT-23-2014. %
% %
% Permission is granted to copy, distribute, and/or modify this program %
% under the terms of the GNU General Public License, version 2 or any %
% later version published by the Free Software Foundation. %
% %
% 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 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw 2D Dataset with GUI %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all; clear all; clc
% Create Figure
fig1 = figure('Color',[1 1 1]);
limits = [0 10 -5 5];
axis(limits)
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0.25, 0.55, 0.2646 0.4358]);
grid on
% Draw Reference Trajectories
[data, hp] = draw_mouse_data_on_DS(fig1, limits);
% Process Drawn Data for DS learning
[Data, Data_sh, att, x0_all, dt] = processDrawnData(data);
% Position/Velocity Trajectories
vel_samples = 10; vel_size = 0.5;
[h_data, h_att, h_vel] = plot_reference_trajectories_DS(Data, att, vel_samples, vel_size);
% Extract Position and Velocities
M = size(Data,1)/2;
Xi_ref = Data(1:M,:);
Xi_dot_ref = Data(M+1:end,:);
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% To use this dataset go to the demo_loadData_*.m scripts %
%% and start with the[Step 2] block of code %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%