Skip to content

Commit

Permalink
pass through the option of limiting data points stored during a simul…
Browse files Browse the repository at this point in the history
…ink sim.

verified that I could simulate atlas balancing for 100 seconds (without matlab continually grabbing memory) and get back just the last few seconds.
i suspect this resolves openhumanoids/oh-distro-private#1430
  • Loading branch information
RussTedrake committed Apr 27, 2015
1 parent a595dd8 commit 22cb177
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion systems/@DynamicalSystem/simulate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
% @option gui_control_interface set to true to bring up a figure with play/stop buttons @default false
% @option lcm_control_interface channel on which to listen for lcmt_simulation_control messages. @default '' -- which means no lcm
% interface
% @option MaxDataPoints integer N to limit output to the last N data
% points. useful for running very long simulations.

checkDependency('simulink');
if ~exist('DCSFunction','file')
Expand Down Expand Up @@ -84,7 +86,13 @@
pstruct.StateSaveName = 'xout';
pstruct.SaveOutput = 'on';
pstruct.OutputSaveName = 'yout';
pstruct.LimitDataPoints = 'off';
if isfield(options,'MaxDataPoints') && ~isinf(options.MaxDataPoints)
pstruct.LimitDataPoints = 'on';
pstruct.MaxDataPoints = num2str(options.MaxDataPoints);
else
pstruct.LimitDataPoints = 'off'
end

%pstruct.SaveOnModelUpdate = 'false';
%pstruct.AutoSaveOptions.SaveModelOnUpdate = 'false';
%pstruct.AutoSaveOptions.SaveBackupOnVersionUpgrade = 'false';
Expand Down

0 comments on commit 22cb177

Please sign in to comment.