File size: 811 Bytes
246c106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import numpy as np
from sim.main import InteractiveDigitalWorld
from sim.simulator import RobomimicSimulator
from sim.policy import RandomJointPositionPolicy

if __name__ == '__main__':
    robomimic_simulator = RobomimicSimulator(
        env_name='lift'
    )
    random_policy = RandomJointPositionPolicy(
        action_bounds=(
            np.array([-np.pi, -np.pi, -np.pi, -np.pi, -np.pi, -np.pi, -np.pi]),
            np.array([np.pi, np.pi, np.pi, np.pi, np.pi, np.pi, np.pi])
        )
    )
    playground = InteractiveDigitalWorld(
        simulator=robomimic_simulator,
        policy=random_policy,
        offscreen=True,
        window_size=(512, 512)
    )

    for _ in range(1000):
        playground.step()

    playground.save_video(save_path='test.mp4', as_gif=False)
    playground.close()