系统为Ubuntu16.04来安装Gym-TORCS
安装pip:
sudo apt-get install python-pip sudo pip install --upgrade pip
安装python 3。
安装xautomation:
sudo apt-get install xautomation
安装OpenAI-Gym:https://github.com/openai/gym
sudo apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig sudo pip install 'gym[all]'
安装Gym-TORCS:https://github.com/ugo-nama-kun/gym_torcs
git clone https://github.com/ugo-nama-kun/gym_torcs.git cd /home/yyy/gym_torcs/vtorcs-RL-color sudo apt-get install libglib2.0-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libplib-dev libopenal-dev libalut-dev libxi-dev libxmu-dev libxrender-dev libxrandr-dev libpng12-dev ./configure make sudo make install sudo make datainstall
然后即可开始运行了:
sudo torcs
依次点击Race/Practice/New Race,启动服务器。
另开命令窗口:
cd ~/gym_torcs
python snakeoil3_gym.py开始自动跑车,按F2切换到第一人称视角。
画面中右下方有个十字,表示右转左转油门刹车。