Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#1444 from eric-wieser/fix-visualizer
Browse files Browse the repository at this point in the history
Make sure the visualizer includes the final timestep
  • Loading branch information
RussTedrake committed Oct 28, 2015
2 parents 0570386 + 325cef3 commit 75b1f14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drake/systems/visualizers/Visualizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ function start_playback(source, eventdata)
function timer_draw(timerobj,event)
t=t0+obj.playback_speed*toc;
if (t>tspan(end))
stop(timerobj);
return;
t = tspan(end)
end
if (ts(1)>0) t = round((t-ts(2))/ts(1))*ts(1) + ts(2); end % align with sample times if necessary
x = xtraj.eval(t);
Expand All @@ -202,6 +201,10 @@ function timer_draw(timerobj,event)
stop(timerobj);
return;
end
if (t == tspan(end))
stop(timerobj);
return;
end
end
end
update_time_display(time_slider, [])
Expand Down

0 comments on commit 75b1f14

Please sign in to comment.