mirror of
https://github.com/wassname/pyrobolearn.git
synced 2026-09-18 12:50:30 +08:00
26 lines
482 B
Python
26 lines
482 B
Python
#!/usr/bin/env python
|
|
"""Load the Walker2D Mujoco model.
|
|
"""
|
|
|
|
from itertools import count
|
|
from pyrobolearn.simulators import BulletSim
|
|
from pyrobolearn.worlds import BasicWorld
|
|
from pyrobolearn.robots import Walker2D
|
|
|
|
# Create simulator
|
|
sim = BulletSim()
|
|
|
|
# create world
|
|
world = BasicWorld(sim)
|
|
|
|
# create robot
|
|
robot = Walker2D(sim)
|
|
|
|
# print information about the robot
|
|
robot.print_info()
|
|
|
|
# run simulation
|
|
for i in count():
|
|
# step in simulation
|
|
world.step(sleep_dt=1./240)
|