Skip to content
Snippets Groups Projects
Commit 89bdaebb authored by Theo Brockmann's avatar Theo Brockmann
Browse files

Upload New File

parent e5c01466
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 12 17:17:49 2021
@author: theob
"""
import asyncio
import Gym_new
import time
import nest_asyncio
import show_image as si
async def main():
image_mode = 'L'
env = Gym_new.Gym()
await env.connect_websocket()
# Resets the enviroment
observation, reward, done, info = await env.reset("",0.01)
print(observation)
print(reward)
print(done)
# Makes 1 step only driving straight
observation, reward, done, info = await env.step("accelerate,screen_on", 0.17)
print(observation)
print(reward)
print(done)
try:
# Test show Image
si.show_image(image_mode,info['thumbnail']['width'],info['thumbnail']['height'],info['thumbnail']['image'])
except Exception as e:
print("failed showing image: " + str(e))
if __name__ == "__main__":
nest_asyncio.apply()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment