TensorKart icon indicating copy to clipboard operation
TensorKart copied to clipboard

Update record.py to use gym

Open bzier opened this issue 8 years ago • 2 comments

Now that the main play.py program uses the gym environment, record.py should be updated to use this framework as well. This will simplify the setup/recording process and should allow for more consistency between the two aspects of execution.

bzier avatar Apr 01 '17 23:04 bzier

@kevinhughes27, When you get the chance, please take a look at my gym-record branch. I have re-written record.py to use the gym environment. On my machine, performance is terrible, and I'd like to have you test it out and see what your experience is. Please experiment with the SAMPLE_RATE at the top of the file too.

For now, I had to get rid of the wx GUI because running a wx.App in DISPLAY :1 for the screenshots of the emulator in XVFB conflicts with running the wx.App in DISPLAY :0 for the record.py GUI. Eventually, I'd like to get rid of wx in the gym environment(9), at which point, the GUI could be restored here.

In the meantime, pay attention to the prompts on the command line. It will load up the environment, and then prompt you to hit enter or quit. Then it will get the window open and prompt for another enter. At this point, you can start driving with the controller and the program will record samples. It will detect the end of the race and then prompt you to record again or quit.

Give it a shot when you have some time and let me know if you have any feedback. Thanks.

bzier avatar Apr 02 '17 02:04 bzier

I really like the command line prompts - this definitely simplifies the data collection process since the script does most of the setup work (like aligning windows etc).

We don't have to bring back the GUI, instead we could pop open a matplotlib window with the joystick data but even that seems a bit overkill. Another option would be to print the joystick data in the console. The viewer is still there to see the graphs next to the images if required.

The performance wasn't great for me either, it probably ran at 60% - 70% of the real speed. So definitely playable but I wonder why its so slow. (It might actually be easier to train in semi slow motion lol).

I also have to post this meta image of the alignment issue:

img_0

kevinhughes27 avatar Apr 12 '17 01:04 kevinhughes27