Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

hello world example doesnt produce video

Open jtoy opened this issue 10 months ago • 6 comments

import genesis as gs

gs.init(backend=gs.gpu)

scene = gs.Scene( show_viewer = True, viewer_options = gs.options.ViewerOptions( res = (1280, 960), camera_pos = (3.5, 0.0, 2.5), camera_lookat = (0.0, 0.0, 0.5), camera_fov = 40, max_FPS = 60, ), vis_options = gs.options.VisOptions( show_world_frame = True, world_frame_size = 1.0, show_link_frame = False, show_cameras = False, plane_reflection = True, ambient_light = (0.1, 0.1, 0.1), ), renderer=gs.renderers.Rasterizer(), )

plane = scene.add_entity( gs.morphs.Plane(), ) franka = scene.add_entity( gs.morphs.MJCF(file='xml/franka_emika_panda/panda.xml'), )

cam = scene.add_camera( res = (640, 480), pos = (3.5, 0.0, 2.5), lookat = (0, 0, 0.5), fov = 30, GUI = False, )

scene.build()

render rgb, depth, segmentation, and normal

rgb, depth, segmentation, normal = cam.render(rgb=True, depth=True, segmentation=True, normal=True)

cam.start_recording() import numpy as np

for i in range(120): scene.step() cam.set_pose( pos = (3.0 * np.sin(i / 60), 3.0 * np.cos(i / 60), 2.5), lookat = (0, 0, 0.5), ) cam.render() cam.stop_recording(save_to_filename='video.mp4', fps=30)

it just seems to sit there:

[Genesis] [11:36:48] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮ [Genesis] [11:36:48] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│ [Genesis] [11:36:48] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯ [Genesis] [11:36:49] [INFO] Running on [Apple M1 Max] with backend gs.metal. Device memory: 32.00 GB. [Genesis] [11:36:49] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: None, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'. [Genesis] [11:36:49] [INFO] Scene <69300f1> created. [Genesis] [11:36:49] [INFO] Adding <gs.RigidEntity>. idx: 0, uid: <7cfebb9>, morph: <gs.morphs.Plane>, material: <gs.materials.Rigid>. [Genesis] [11:36:49] [INFO] Adding <gs.RigidEntity>. idx: 1, uid: <3a76479>, morph: <gs.morphs.MJCF(file='/Users/jtoy/.asdf/installs/python/3.10.4/lib/python3.10/site-packages/genesis/assets/xml/franka_emika_panda/panda.xml')>, material: <gs.materials.Rigid>. [Genesis] [11:36:50] [INFO] Building scene <69300f1>... [Genesis] [11:36:54] [INFO] Compiling simulation kernels... [Genesis] [11:36:59] [INFO] Building visualizer... [Genesis] [11:37:01] [WARNING] Non-linux system detected. In order to use the interactive viewer, you need to manually run simulation in a separate thread and then start viewer. See examples/render_on_macos.py. [Genesis] [11:37:01] [INFO] Viewer created. Resolution: 1280×960, max_FPS: 60. [Genesis] [11:37:01] [INFO] Running at 2824.03 FPS.

jtoy avatar Dec 19 '24 18:12 jtoy