1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gym_torcsをubutnu16で動かすために

Last updated at Posted at 2016-10-29

前書き

ubutnu16でgym_torcsを実行するための環境構築に苦労したので, 備忘録として残しておきます.

gym_torcsとは

ググってください.

gym_torcsをubutnu16で動かすために

gym_torcsを入れる前にまず, 以下の3つをインストールします.

sudo apt-get install xautomation
sudo pip3 install bumpy
sudo pip3 install gym

次に ugo-nama-kunさんのgitからgym_torcs_masterをダウンロードします.
https://github.com/ugo-nama-kun/gym_torcs

ダウンロード後に,
gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/simu.cppの64行目を書き換えます.

simu.cpp
if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
simu.cpp
if (isnan((float)(car->ctrl->gear)) || isinf((float)(car->ctrl->gear))) car->ctrl->gear = 0;

書き換えた後に, 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

ターミナルでtorcsと書き, 実行できれば成功です.

gym_torcs/vtorcs-RL-colorでsnakeoil3_gym.pyを実行することで, デモを見られます.

python3 snakeoil3_gym.py

参考文献

http://www.jianshu.com/p/a3432c0e1ef2
https://research.preferred.jp/2016/05/

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?