Skip to content

Commit b6645f6

Browse files
committed
playback the last log file
1 parent 31c3fc0 commit b6645f6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

scripts/run_mech_explorer.m

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
function run_mech_explorer(pendulum_type, obstacle_enable, filename)
1+
function run_mech_explorer(pendulum_type, obstacle_enable, varargin)
22
% Copyright (C) 2024 Fondazione Istitito Italiano di Tecnologia (IIT)
33
% All Rights Reserved.
4+
%#ok<*AGROW>
45
%#ok<*NASGU>
56

7+
if nargin == 2
8+
S1 = dir('./cache');
9+
S1 = S1(~[S1.isdir]);
10+
S2 = [];
11+
for i = 1:length(S1)
12+
if contains(S1(i).name, 'voltage')
13+
S2 = [S2; S1(i)];
14+
end
15+
end
16+
[~, idx] = sort([S2.datenum]);
17+
filename = ['./cache/' S2(idx(end)).name];
18+
else
19+
filename = varargin{1};
20+
end
21+
622
data = load(filename);
723
Tend = data.voltage.Time(end);
824

tests/test_req.mldatx

-72 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)