Skip to content

Commit

Permalink
fix: Do not increment _recording_frame_num on each elem; instead, on …
Browse files Browse the repository at this point in the history
…each step
  • Loading branch information
EricCousineau-TRI committed Jun 8, 2020
1 parent 961b902 commit 425c84c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bindings/pydrake/systems/meshcat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,16 @@ def DoPublish(self, context, event):
# The MBP parsers only register the plant as a nameless source.
# TODO(russt): Use a more textual naming convention here?
pose_matrix = pose_bundle.get_transform(frame_i)
self.vis[self.prefix][source_name][str(model_id)][frame_name]\
.set_transform(pose_matrix.GetAsMatrix4())
cur_vis = (
self.vis[self.prefix][source_name][str(model_id)][frame_name])
cur_vis.set_transform(pose_matrix.GetAsMatrix4())
if self._is_recording:
with self._animation.at_frame(
self.vis[self.prefix][source_name][str(model_id)]
[frame_name], self._recording_frame_num) as frame:
frame.set_transform(pose_matrix.GetAsMatrix4())
self._recording_frame_num += 1
cur_vis, self._recording_frame_num) as cur_vis_frame:
cur_vis_frame.set_transform(pose_matrix.GetAsMatrix4())

if self._is_recording:
self._recording_frame_num += 1

def start_recording(self):
"""
Expand Down

0 comments on commit 425c84c

Please sign in to comment.