Skip to content

Commit

Permalink
Cassette animation (#33)
Browse files Browse the repository at this point in the history
* Update to new atframe signature.

* Work around JuliaLabs/Cassette.jl#89.

* Bump MeshCat lower bound, undo reverse workaround.

MeshCat lower bound also takes care of Cassette lower bound,
rdeits/MeshCat.jl#117.
  • Loading branch information
tkoolen authored Jan 9, 2020
1 parent 762d3fe commit 4183805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ InteractBase = "≥ 0.8.0"
Interpolations = "≥ 0.9.0"
LoopThrottle = "≥ 0.0.1"
MechanismGeometries = "≥ 0.4.0"
MeshCat = "≥ 0.7.0"
MeshCat = "≥ 0.8.0"
NBInclude = "≥ 1.1.0"
OrderedCollections = "≥ 1.0.0"
RigidBodyDynamics = "2"
Expand Down
7 changes: 4 additions & 3 deletions src/animate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ function MeshCat.setanimation!(mvis::MechanismVisualizer,
num_frames = floor(Int, (times[end] - first(times)) * fps)
for frame in 0:num_frames
time = first(times) + frame / fps
set_configuration!(state(mvis), interpolated_configurations(time))
atframe(animation, visualizer(mvis), frame) do frame_visualizer
_render_state!(MechanismVisualizer(state(mvis), frame_visualizer))
let mvis = mvis, interpolated_configurations = interpolated_configurations
atframe(animation, frame) do
set_configuration!(mvis, interpolated_configurations(time))
end
end
end
setanimation!(visualizer(mvis), animation, play=play, repetitions=repetitions)
Expand Down

0 comments on commit 4183805

Please sign in to comment.