Skip to content

Commit

Permalink
playback the last log file
Browse files Browse the repository at this point in the history
  • Loading branch information
pattacini committed Feb 11, 2024
1 parent 31c3fc0 commit b6645f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/run_mech_explorer.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
function run_mech_explorer(pendulum_type, obstacle_enable, filename)
function run_mech_explorer(pendulum_type, obstacle_enable, varargin)
% Copyright (C) 2024 Fondazione Istitito Italiano di Tecnologia (IIT)
% All Rights Reserved.
%#ok<*AGROW>
%#ok<*NASGU>

if nargin == 2
S1 = dir('./cache');
S1 = S1(~[S1.isdir]);
S2 = [];
for i = 1:length(S1)
if contains(S1(i).name, 'voltage')
S2 = [S2; S1(i)];
end
end
[~, idx] = sort([S2.datenum]);
filename = ['./cache/' S2(idx(end)).name];
else
filename = varargin{1};
end

data = load(filename);
Tend = data.voltage.Time(end);

Expand Down
Binary file modified tests/test_req.mldatx
Binary file not shown.

0 comments on commit b6645f6

Please sign in to comment.