ugo-nama-kun / gym_torcs Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi,
When I execute ./configure
in vtorcs folder, the command runs smoothly. However when i execute the next command which is make
I get the error as documented in this pastebin link.
Any idea why I get so many errors? I suspect that the makefile is not well formatted.
Thanks
enables running multiple torcs instances, each of which is controlled by different TorcsEnv instances. It would helpful if you run multiple experiments at the same time, or running parallel RL algorithms.
After this PR, if you want to run multiple torcs, just create TorcsEnv instances with different port values.
Add -title option to torcs so that its window title can be changed
Use xdotool instead of xte so that it can specify which window to control by its title
Chage TorcsEnv and Client accordingly
Remove auto-generated files (This is not related to the subject of the PR. If there's a problem, I'll omit this change.)
No angle attribute in Observation?
>>>dir(ob)
['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_asdict', '_fields', '_make', '_replace', '_source', 'count', 'focus', 'index', 'opponents', 'rpm', 'speedX', 'speedY', 'speedZ', 'track', 'wheelSpinVel']
**gym_torcs git:(master)** ✗ python snakeoil3_gym.py
Waiting for server on 3101............
Count Down : 4
Waiting for server on 3101............
Count Down : 3
Waiting for server on 3101............
Count Down : 2
Waiting for server on 3101............
Count Down : 1
Waiting for server on 3101............
Count Down : 0
Waiting for server on 3101............
Count Down : -1
relaunch torcs
Visual Properties Report
------------------------
Compatibility mode, properties unknown.
WARNING: ssgLoadTexture: Cannot determine file type for './(null)'
Waiting for server on 3101............
Count Down : 4
Waiting for server on 3101............
Count Down : 3
Waiting for server on 3101............
Count Down : 2
Waiting for server on 3101............
Count Down : 1
Waiting for server on 3101............
Count Down : 0
Waiting for server on 3101............
Count Down : -1
relaunch torcs
Visual Properties Report
------------------------
Compatibility mode, properties unknown.
WARNING: ssgLoadTexture: Cannot determine file type for './(null)'
Hi,
I am working on the new projects in gym_torcs which requires faster frames per second. I found that in
ob, reward, done, _ = env.step(action)
which calls line 122-124 in gym_torcs.py
client.respond_to_server()
# Get the response of TORCS
client.get_servers_input()
is very slow. the 2 lines above took 0.2 seconds (so 5 fps)
Do you know if there is anyway I can improve the fps?
Thanks,
Ben
I want to see the road with first-person-view, but the game's default viewpoint is non-first-person-view, how could I change the code to satisfy my need?
Hi,
I followed the installation steps.
Unfortunately after I finished to install gym_torcs, I got the following errror for typing "torcs" in command.
would you please help me to solve this problem?
Compatibility mode, properties unknown.
freeglut (/usr/local/lib/torcs/torcs-bin): ERROR: Internal error in function fgOpenWindow
Hi,
I want to launch multiple gym_torcs
environments on my machine so that I can run multiple simulations in parallel. Currently when I try to launch an extra simulation, the previous one crashes. The problem is likely the fact that the client and server always talk through the 3001
port. Is there a way to assign different ports to different instances of gym_torcs
?
Thank you,
Anirban
I am implementing RL algorithms using gym_torcs.
Would you tell me how to extract larger images (e.g. 200×200×3) than default images 64×64×3 ?
I changed line 7 and 8 in gym_torcs/vtorcs-RL-color/exp-settings/config/screen.xml as follows,
<attnum name="x" val="200"/>
<attnum name="y" val="200"/>
but it doesn't work well. (output image is 64×64×3).
If you read the 19 tracks' information and print it when you are running the car on torcs, you can find the information is very amazing. When the car turn left or turn right in a large curve, if you see the printed 19 tracks' information carefully, you will find the track[1] or track [2] or track[17] or track[16] or the others larger than you expect sometimes.
I think the track return a larger value on the other side of the curve instead of closer to car.
I want to change the source code of vtorcs and then reinstall it.
I don't know what if I reinstall it directly so firstly I need to uninstall vtorcs.
Any method is OK, thank you!
Hi ugo-nama-kun, I just stumbled upon your repo by chance. I am one of the original authors of vtorcs. I am very happy if my code gets used and distributed by the community, I only wish you had forked it properly, or even better included it as a submodule. Grabbingthe code as you did and then commit it yourself in another repo hides the real authors from the git-blame (and I sure am not even the main one), and cuts any chance for me to pull patches from your work into my repo. Since your work seem much more popular, I would have been happy even to even have you as the official maintainer. Let me know if you like to reconnect to my work, else all these comments marked with "giuse" in your repository may look... well, quite weird :) cheers!
Hi,
I am trying to get gym_torcs to work on my Ubuntu 14.04. When I execute the sample_experiement.py file, I get the following error:
gfParmSetStr: fopen (config/graph.xml, "wb") failed
Full log:
Fuel consumption disabled!
Car damages disabled!
Laptime limit disabled!
Image generation is ON!
Visual Properties Report
------------------------
Compatibility mode, properties unknown.
Waiting for request on port 3101
TORCS Experiment Start.
Episode : 0
Client connected on 3101..............
OpenAL backend info:
Vendor: OpenAL Community
Renderer: OpenAL Soft
Version: 1.1 ALSOFT 1.14
Available sources: 256
Available buffers: 1024 or more
Dynamic Sources: requested: 235, created: 235
#static sources: 21
#dyn sources : 235
gfParmSetStr: fopen (config/graph.xml, "wb") failed
sw 64 - sh 64 - vw 64 - vh 64 - imgsize 12288
Traceback (most recent call last):
File "example_experiment.py", line 26, in <module>
ob = env.reset(relaunch=True)
File "/home/pavitrakumar/Desktop/gym_torcs-master/gym_torcs.py", line 192, in reset
self.observation = self.make_observaton(obs)
File "/home/pavitrakumar/Desktop/gym_torcs-master/gym_torcs.py", line 272, in make_observaton
image_rgb = self.obs_vision_to_image_rgb(raw_obs[names[8]])
File "/home/pavitrakumar/Desktop/gym_torcs-master/gym_torcs.py", line 242, in obs_vision_to_image_rgb
return np.array([r, g, b], dtype=np.uint8)
TypeError: long() argument must be a string or a number, not 'NoneType'
pavitrakumar@pavitrakumar-PC:~/Desktop/gym_torcs-master$ Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
.
.
.
I am trying this on python 2.x with the necessary imports to make it work (print and division), but I am not sure where the requested file (graph.xml) is located.
I understand that it's possible to change the race track from the GUI of TORCS and then command the car from python. Is it possible to select the race track form python itself?
This can be useful if you want to run a single script to evaluate your model on a bunch different racetracks.
Thanks,
Avi
Hi,
I want to train the AI agent in a race track with multi-players,learning the abilities for collision avoidance and overtaking.
How to set the configuration of the game?
Thank you very much.
Runnning vtorcs by supplying a default config file
torcs -r <Path-to-config.xml>
doesn't seem to work. Any ideas?
It says in the installation guid of vtorcs-color:
Requires plib 1.8.5, FreeGLUT or GLUT, be aware to compile plib with -fPIC on AMD64 if you run a 64 bit version of Linux. Be aware that maybe just 1.8.5 works.
I'm still new to this kind of stuff, so could you please tell how to do that?
thanks very much for your work!I want to use it but I meet a problem.I can import gym_torcs,but can't import TorcsEnv.
Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import gym_torcs
from gym_torcs import TorcsEnv
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'TorcsEnv'
could you help me ?
Hi,
When i run snakeoil3_gym.py in Practice mode, it gets server state properly. (e.g. speedX, angle, tracPos).
But when i run snakeoil3_gym.py in Quick Race mode, it gets another car's server state.
For example, if i select two cars (scr_server 1 and tita 3) in 'Selected' list in Quick Race configuration, then snakeoil3_gym.py gets speedX, tracPos of tita not of scr_server.
Do you have any idea of this problem?
Thank you.
anyone install on mac os?thanks
In Ubunto 18, when I run ./configure everything goes smoothly. But when I command "make"
I am facing with the following error. Could you please help me?
make TORCS_BASE=/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color MAKE_DEFAULT=/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk make[1]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color' make[2]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/interfaces' Exporting car.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/car.h Exporting graphic.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/graphic.h Exporting js.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/js.h Exporting playerpref.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/playerpref.h Exporting raceman.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/raceman.h Exporting replay.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/replay.h Exporting robot.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/robot.h Exporting simu.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/simu.h Exporting telemetry.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/telemetry.h Exporting track.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/track.h make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/interfaces' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' Exporting xml.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/xml.h Exporting xmlparse.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/xmlparse.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgf' Exporting tgf.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tgf.h Exporting os.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/os.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgf' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgfclient' Exporting tgfclient.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tgfclient.h Exporting screen_properties.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/screen_properties.h Exporting glfeatures.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/glfeatures.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgfclient' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/client' Exporting client.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/client.h Exporting exitmenu.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/exitmenu.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/client' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' Exporting confscreens.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/confscreens.h Exporting driverconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/driverconfig.h Exporting joystickconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/joystickconfig.h Exporting mouseconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/mouseconfig.h Exporting controlconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/controlconfig.h Exporting graphconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/graphconfig.h Exporting simuconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/simuconfig.h Exporting soundconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/soundconfig.h Exporting openglconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/openglconfig.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/racescreens' Exporting racescreens.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/racescreens.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/racescreens' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/robottools' Exporting robottools.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/robottools.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/robottools' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/raceengineclient' Exporting singleplayer.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/singleplayer.h Exporting raceinit.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/raceinit.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/raceengineclient' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/learning' Exporting policy.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/policy.h Exporting ann_policy.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/ann_policy.h Exporting ANN.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/ANN.h Exporting learn_debug.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/learn_debug.h Exporting real.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/real.h Exporting string_utils.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/string_utils.h Exporting List.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/List.h Exporting MathFunctions.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/MathFunctions.h Exporting Distribution.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/Distribution.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/learning' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/portability' Exporting portability.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/portability.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/portability' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/math' Exporting linalg_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/linalg_t.h Exporting v2_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/v2_t.h Exporting v3_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/v3_t.h Exporting v4_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/v4_t.h Exporting straight2_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/straight2_t.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/math' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' Exporting osspec.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/osspec.h make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu' make[5]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2' make[6]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0' make[7]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include' make[8]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/3D' Exporting Basic.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Basic.h Exporting Matrix.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Matrix.h Exporting Point.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Point.h Exporting Quaternion.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Quaternion.h Exporting Tuple3.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Tuple3.h Exporting Tuple4.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Tuple4.h Exporting Vector.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Vector.h make[8]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/3D' make[8]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/SOLID' Exporting solid.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/SOLID/solid.h make[8]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/SOLID' make[7]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include' make[6]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0' make[5]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2' make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules' make[2]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[2]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' make[5]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml/gennmtab' make[5]: Nothing to be done for 'tools'. make[5]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml/gennmtab' make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/accc' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/accc' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfs2ac' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfs2ac' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfsperf' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfsperf' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/package' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/package' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/texmapper' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/texmapper' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/trackgen' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/trackgen' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' make[3]: Nothing to be done for 'tools'. make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' make[2]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[2]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' make[4]: *** No rule to make target '/home/abaheri/Desktop/gym_torcs-master/gym_torcs-master/vtorcs-RL-color/export/include/tgfclient.h', needed by 'controlconfig.o'. Stop. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk:679: recipe for target 'subdirs' failed make[3]: *** [subdirs] Error 1 make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk:679: recipe for target 'subdirs' failed make[2]: *** [subdirs] Error 1 make[2]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk:679: recipe for target 'subdirs' failed make[1]: *** [subdirs] Error 1 make[1]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color' Makefile:30: recipe for target 'restart' failed make: *** [restart] Error
2``
Encountered error running this file. Error message below:
File "snakeoil3_gym.py", line 246
if 'identified' in sockdata:
^
IndentationError: expected an indented block
I use "torcs -T" to run in text mode without vision,but the car run in ”quick race”. I wonder how to change to "practice"!!! Anyone knows ?
Hi, I am trying to run your code with vision input by setting . I have set the resolution to 64x64, but the screen sometimes got freeze and stuck for about a few second before the program recover back to normal vision output. Do you have any ideas about how to solve it? BTW without vision it works perfectly fine :)
Thanks in advance.
I think 64x64 img is too small for some deep networks. What makes the codes can only get 64x64 imgs? If I want to change it, which code file shall I change?
In the gym_torcs.py, whatever I change the value of default_speed , speedX always is less than 82.....
Hi,
When i run the default code and follow the instructions, I get the following error:
sahil@CoolToad:/gym_torcs$ python example_experiment.py
pkill: killing pid 20651 failed: Operation not permitted
pkill: killing pid 20668 failed: Operation not permitted
Fuel consumption disabled!
Car damages disabled!
Laptime limit disabled!
Image generation is ON!
Visual Properties Report
------------------------
Compatibility mode, properties unknown.
TORCS Experiment Start.
Episode : 0
Client connected on 3101..............
cannot bind socketTraceback (most recent call last):
File "example_experiment.py", line 24, in <module>
ob = env.reset(relaunch=True)
File "/gym_torcs/gym_torcs.py", line 190, in reset
self.observation = self.make_observaton(obs)
File "/gym_torcs/gym_torcs.py", line 267, in make_observaton
image_rgb = self.obs_vision_to_image_rgb(raw_obs[names[8]])
KeyError: 'img'
Any idea why this happens?
Hi, I'm getting this following build error when I'm trying to make vtorcs-
simu.cpp: In function ‘void ctrlCheck(tCar*)’:
simu.cpp:64:9: error: non-floating-point argument in call to function ‘__builtin_isnan’
if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
^
simu.cpp:64:35: error: non-floating-point argument in call to function ‘__builtin_isinf_sign’
if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
Is there a fix for this?
As I know, the original torcs game support the -r command line argument, which run the torcs under the text mode. Something like this:
torcs -r config.xml
So I wonder if gym_torcs can run under the text mode but also I can capture the image of the game?
@ugo-nama-kun
Hi~Currently I can run snakeoil3_gym.py in Practice mode. Can I ask how can I run snakeoil3_gym.py in other racing mode? I start torcs --> Race --> Non-Championship Race --> New Race
Then on another terminal I run python snakeoil3_gym.py but I got the following error
ben@i5:~/torcs_race$ python snakeoil3_gym.py
Waiting for server on 3101............
Count Down : 5
Waiting for server on 3101............
Count Down : 4
The above procedure works for Practice Mode...
Thanks
Hi,
I was trying to train Deep Deterministic policy on Torcs environment.
Is there a way to stop video rendering during the training. Just like openAI gym has
env.render()
to explicitly render when called and otherwise not.
Thanks,
Apoorv
@ugo-nama-kun
Hello ugo-nama-kun,
Our team is currently using TorcsEnv to test behaviour cloning, and there there is an FPS discrepancy between user demonstration (60FPS) and TorcsEnv (< 10 FPS). May I ask how to modify your source codes, so that the TorcsEnv can provide a 60 FPS testing environment?
how can I get car state and snapshot? thx
I failed to install libglu1-mesa-dev,so I just use "pip install torcs". But it seems that many problem occur.
When I run snakeoil3_gym.py in https://github.com/yanpanlau/DDPG-Keras-Torcs , it look like this and always relauch.
/usr/bin/python2.7 /home/hanzy/software/gym_torcs-master/snakeoil3_gym.py
Waiting for server on 3101............
Count Down : 5
Waiting for server on 3101............
Count Down : 4
Waiting for server on 3101............
Count Down : 3
Waiting for server on 3101............
Count Down : 2
Waiting for server on 3101............
Count Down : 1
Waiting for server on 3101............
Count Down : 0
Waiting for server on 3101............
Count Down : -1
relaunch torcs
Waiting for server on 3101............
Count Down : 4
Waiting for server on 3101............
Count Down : 3
Waiting for server on 3101............
Count Down : 2
Waiting for server on 3101............
Count Down : 1
Waiting for server on 3101............
Count Down : 0
Waiting for server on 3101............
Count Down : -1
relaunch torcs
Waiting for server on 3101............
When I run ddpg.py in https://github.com/yanpanlau/DDPG-Keras-Torcs , an error below happen.
/usr/bin/python2.7 /home/hanzy/software/gym_torcs-master/ddpg.py
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/hanzy/software/gym_torcs-master/ddpg.py", line 10, in
from keras.engine.training import collect_trainable_weights
ImportError: cannot import name collect_trainable_weights
Process finished with exit code 1
WHY!!!
Hi
I want to collect observation and action data generated by expert demonstration. So, How could I drive it manually?
Thanks very much!
Hi,
Thanks for your package.
I am trying to use it for RL and DNN but having problem with making it work. Basically my problem is that it kind of freezes. I tried to run the 'example_experiment.py' as well but the same thing happens, it runs TORCS environment and progresses until it starts the race but after that the car does't move or in another word camera view does now changes (it slowly, very slow, moves toward left but not forward). I am not sure where is the problem. I was trying to test it with python 2.x and 3.x and the following is the result:
--- with python2
amir-ai@Amir:~/gym_torcs$ python example_experiment.py
Compatibility mode, properties unknown.
TORCS Experiment Start.
Episode : 0
Waiting for server on 3101............
Count Down : 5
Waiting for server on 3101............
Count Down : 4
Waiting for server on 3101............
Count Down : 3
Waiting for server on 3101............
Count Down : 2
Waiting for server on 3101............
Count Down : 1
Waiting for server on 3101............
Count Down : 0
Waiting for server on 3101............
Count Down : -1
relaunch torcs
Compatibility mode, properties unknown.
Waiting for server on 3101............
Count Down : 4
Waiting for server on 3101............
Count Down : 3
Waiting for server on 3101............
Count Down : 2
Waiting for request on port 3101
Waiting for server on 3101............
Count Down : 1
Received from server: identified
Client connected on 3101..............
OpenAL backend info:
Vendor: OpenAL Community
Renderer: OpenAL Soft
Version: 1.1 ALSOFT 1.14
Available sources: 256
Available buffers: 1024 or more
Dynamic Sources: requested: 235, created: 235
#static sources: 21
#dyn sources : 235
gfParmSetStr: fopen (config/graph.xml, "wb") failed
sw 64 - sh 64 - vw 64 - vh 64 - imgsize 12288
Traceback (most recent call last):
File "example_experiment.py", line 24, in
ob = env.reset(relaunch=True)
File "/home/amir-ai/gym_torcs/gym_torcs.py", line 192, in reset
self.observation = self.make_observaton(obs)
File "/home/amir-ai/gym_torcs/gym_torcs.py", line 275, in make_observaton
image_rgb = self.obs_vision_to_image_rgb(raw_obs[names[8]])
File "/home/amir-ai/gym_torcs/gym_torcs.py", line 232, in obs_vision_to_image_rgb
r = image_vec[0:len(image_vec):3]
TypeError: object of type 'float' has no len()
amir-ai@Amir:~/gym_torcs$ Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
AL lib: ReleaseALC: 1 device not closed
^C
--- with python3
amir-ai@Amir:~/gym_torcs$ python3 example_experiment.py
/usr/local/lib/python3.4/dist-packages/matplotlib/backends/backend_gtk3agg.py:18: UserWarning: The Gtk3Agg backend is known to not work on Python 3.x with pycairo. Try installing cairocffi.
"The Gtk3Agg backend is known to not work on Python 3.x with pycairo. "
Compatibility mode, properties unknown.
Waiting for request on port 3101
TORCS Experiment Start.
Episode : 0
Received from server: b'identified\x00'
Traceback (most recent call last):
File "example_experiment.py", line 24, in
ob = env.reset(relaunch=True)
File "/home/amir-ai/gym_torcs/gym_torcs.py", line 185, in reset
self.client = snakeoil3.Client(p=3101, vision=self.vision) # Open new UDP in vtorcs
File "/home/amir-ai/gym_torcs/snakeoil3_gym.py", line 143, in init
self.setup_connection()
File "/home/amir-ai/gym_torcs/snakeoil3_gym.py", line 191, in setup_connection
if identify in sockdata:
TypeError: 'str' does not support the buffer interface
OpenAL backend info:
Vendor: OpenAL Community
Renderer: OpenAL Soft
Version: 1.1 ALSOFT 1.14
Available sources: 256
Available buffers: 1024 or more
Dynamic Sources: requested: 235, created: 235
#static sources: 21
#dyn sources : 235
gfParmSetStr: fopen (config/graph.xml, "wb") failed
sw 64 - sh 64 - vw 64 - vh 64 - imgsize 12288
amir-ai@Amir-SASLAB:~/gym_torcs$ Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Timeout for client answer
Thanks,
Does anybody know how to design our own track (with possibly 5-6 lanes)?
Any hint would be appropriated :)
Hi~ I'm testing a RL work based on this project, and I wanna to add some obstacles to train the agent to avoid collisions. What should I do to add obstacles in the tracks? Also, is the collision available of these obstacles?
Thanks a lot!
I looked into the TORCS manual, and get to know that you can export more sensor data through tCarElt, any idea how to achieve that? Many thanks!
Somehow I get a black screenshot every run. The window mode is correct 64. I am using torcs and its client from a remote source via ssh.
We are trying to get an observation output of the vision image for each step in order to write an A3C algorithm with tensorflow that will be able to learn from vision.
We have made sure that the resolution is set to 64 x 64 when trying to run the agent and that vision is set to True when calling the environment:
en=TorcsEnv(vision=True, )
We get back an observation dictionary that does not contain an ' img' key, thus we get a KeyError.
I was trying to implement gym_torcs, have successfully completed the training for 397000 episodes. When i do the validation/ inference the car runs only for few seconds and restarts again.
May i know how exactly the validation looks like does it complete the full track after training?
I read your source codes and feel confused with your TorcsEnv.step function.
From line 121 to 124,
# Apply the Agent's action into torcs
client.respond_to_server()
# Get the response of TORCS
client.get_servers_input()
You send the action to the Torcs server first and then get the observations from the torcs instantly, which is used to calculate the reward. However, are you sure the server will respond to the actions before you run "client.get_servers_input()"?
I want to train an agent using DDPG with low-dim input and use it as a teacher to train a imitation learning agent. However, after training DDPG, when I set vision=True, I found DDPG can not perform well. But I set vision=False back, DDPG can drive without any issue.
My question is: are the scales or measurements of the low-dim state different between vision=True
and vision=False
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.