用 meshcat 保存视频?

Saving videos with meshcat?

使用 MeshcatVisualizer 保存视频的标准方法是什么?我知道以下适用于 PyPlotVisualizer 的包装器:

visualizer.start_recording()
simulator.AdvanceTo(T)
ani = visualizer.get_recording_as_animation()

但是 MeshcatVisualizer 没有这两个相关的方法,repo 中似乎没有任何使用它创建视频的示例,none class 确实看起来像有前途的候选人。如果做不到这一点,是否有另一种保存视频以进行 3D 可视化的方法?

我不相信 meshcat 提供了它自己的录制功能,这意味着推荐的工作流程是只使用您最喜欢的屏幕录像机软件。我已将此转发给一些 meshcat 专家,以防他们有更好的推荐。

更新:除了上面的 rdeits 回答外,他在电子邮件中还有更多详细信息:

there's a built in animation API with recording support in meshcat-python (see "Recording an Animation" in https://github.com/rdeits/meshcat-python/blob/master/animation_demo.ipynb ), but AFAICT Drake's MeshcatVisualizer isn't hooked up to it. It might not be that hard to do so--the basic idea is that you can use at_frame to get a representation of a single frame of an animation that behaves like a meshcat.Visualizer. You can call set_transform on that frame, and rather than moving anything in the viewer it will instead record that action into an animation track. Then you can send the whole animation at once to the visualizer and let the browser side handle replaying and recording it.

Meshcat有一个动画工具:https://github.com/rdeits/meshcat-python/blob/master/animation_demo.ipynb,您可以通过MeshcatVisualizer.vis访问MeshcatVisualizermeshcat.Visualizer实例。但是MeshcatVisualizer暂时没有像MeshcatVisualizer.convert_to_video这样的功能支持这个动画工具。也许现在更简单的方法是屏幕录制。