mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 06:00:12 +00:00
1752aa55ca
See https://www.youtube.com/watch?v=DZ5Px-ocelw for video and how-to-install.
27 lines
611 B
Python
27 lines
611 B
Python
import gym
|
|
from envs.bullet.racecarGymEnv import RacecarGymEnv
|
|
|
|
from baselines import deepq
|
|
|
|
|
|
def main():
|
|
|
|
env = RacecarGymEnv(renders=True)
|
|
act = deepq.load("racecar_model.pkl")
|
|
print(act)
|
|
while True:
|
|
obs, done = env.reset(), False
|
|
print("===================================")
|
|
print("obs")
|
|
print(obs)
|
|
episode_rew = 0
|
|
while not done:
|
|
env.render()
|
|
obs, rew, done, _ = env.step(act(obs[None])[0])
|
|
episode_rew += rew
|
|
print("Episode reward", episode_rew)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|