|
14 | 14 | % Scopes |
15 | 15 | N = 64; |
16 | 16 | viewer = HelperOrientationViewer; |
17 | | -ts = dsp.TimeScope; |
18 | | -ts.SampleRate = fs; |
19 | | -ts.TimeSpanOverrunAction = 'Scroll'; |
20 | | -ts.TimeSpan = 1/fs*N; |
21 | | -ts.NumInputPorts = 2; |
22 | | -ts.ShowLegend = true; |
23 | | -ts.ChannelNames = {'Acceleration X','Acceleration Y','Acceleration Z',... |
24 | | - 'Angular Velocity X','Angular Velocity Y','Angular Velocity Z'}; |
25 | | -ts.ShowGrid = true; |
26 | | -ts.LayoutDimensions = [2 ,1]; |
27 | | -ts.AxesScaling = 'Auto'; |
28 | | -ts_parts = clone(ts); |
29 | | -ts_parts.LayoutDimensions = [1 ,1]; |
30 | | -ts_parts.NumInputPorts = 4; |
31 | | -ts_parts.ChannelNames = {'W','X','Y','Z'}; |
32 | | - |
| 17 | +useScope = true; |
| 18 | +if useScope |
| 19 | + ts = dsp.TimeScope; |
| 20 | + ts.SampleRate = fs; |
| 21 | + ts.TimeSpanOverrunAction = 'Scroll'; |
| 22 | + ts.TimeSpan = 1/fs*N; |
| 23 | + ts.NumInputPorts = 2; |
| 24 | + ts.ShowLegend = true; |
| 25 | + ts.ChannelNames = {'Acceleration X','Acceleration Y','Acceleration Z',... |
| 26 | + 'Angular Velocity X','Angular Velocity Y','Angular Velocity Z'}; |
| 27 | + ts.ShowGrid = true; |
| 28 | + ts.LayoutDimensions = [2 ,1]; |
| 29 | + ts.AxesScaling = 'Auto'; |
| 30 | + ts_parts = clone(ts); |
| 31 | + ts_parts.LayoutDimensions = [1 ,1]; |
| 32 | + ts_parts.NumInputPorts = 4; |
| 33 | + ts_parts.ChannelNames = {'W','X','Y','Z'}; |
| 34 | +end |
33 | 35 | %% Get info |
34 | 36 | numSamples = IMU.SamplesPerFrame; |
35 | 37 | t = 0:1/fs:(numSamples-1)/fs; |
|
41 | 43 | viewer(qimu); |
42 | 44 | pause(0); |
43 | 45 | end |
44 | | - ts(acc(ii,:), gyro(ii,:)); |
45 | | - [w,x,y,z] = qimu.parts; |
46 | | - ts_parts(w,x,y,z); |
| 46 | + if useScope |
| 47 | + ts(acc(ii,:), gyro(ii,:)); |
| 48 | + [w,x,y,z] = qimu.parts; |
| 49 | + ts_parts(w,x,y,z); |
| 50 | + end |
47 | 51 | end |
48 | 52 |
|
49 | 53 | %% Cleanup |
50 | 54 | release(ifilt); |
51 | 55 | release(IMU); |
52 | 56 | release(viewer); |
53 | | -release(ts); |
| 57 | +if useScope |
| 58 | + release(ts); |
| 59 | +end |
0 commit comments