2021-11-01 16:51:26 +08:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
"""
|
|
|
|
Shows how to toss a capsule to a container.
|
|
|
|
"""
|
|
|
|
from re import T
|
|
|
|
from mujoco_py import load_model_from_path, MjSim, MjViewer
|
|
|
|
import os
|
|
|
|
import math
|
|
|
|
import keyboard
|
|
|
|
|
2021-11-02 12:21:40 +08:00
|
|
|
model = load_model_from_path("/path/to/a1.xml")
|
2021-11-01 16:51:26 +08:00
|
|
|
sim = MjSim(model)
|
|
|
|
|
|
|
|
viewer = MjViewer(sim)
|
|
|
|
|
|
|
|
sim_state = sim.get_state()
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
|
|
|
sim.step()
|
|
|
|
viewer.render()
|
|
|
|
#print(" ")
|
|
|
|
|
|
|
|
if os.getenv('TESTING') is not None:
|
|
|
|
break
|