TorcsTool is a torcs client for reinforcement learning like gym_torcs. The client developed by udp has some delay when I grab images from Torcs, so TorcsTool develped by shared memory to boost image grab. I modify scr_server
in drivers.
This repo is for torcs-1.3.7.
-
Download torcs-1.3.7.
-
Create git repo, and apply patch.
git apply --ignore-space-change --ignore-whitespace torcs.patch
-
Compile and install torcs
-
Compile and install
scr-server
in your torcs folder. -
Compile shared library.
cd path/to/TorcsTool && make
-
Run
tool.py
andtorcs
return 29 track data collected from scr_server.
- angle: angle between track and car.
- track: distance from car to track edge in 19 direction. You can modify direction in
src_server.cpp
about line 246 in my case. - speed(x|y|z): speed in x,y,z axis.
- wheelSpinVel: rad speed of wheel
- rpm: rpm
return images of torcs. Default grab speed is 10 images per second. You can change grab speed by modifying count in src/libs/raceengineclient/raceengine.cpp
about 767 line in my case.
control car, just set the value.
restart game.
check car status. You can modity ReOneStep
function in src/libs/raceengineclient/raceengine.cpp
to change the status trigger.
- torcs-1.3.7
- python3
- see
requirement.txt
TorcsTool is released under the MIT License.