abhisheknaik96 / MultiAgentTORCS

The multi-agent version of TORCS for developing control algorithms for fully autonomous driving in the cluttered, multi-agent settings of everyday life.
141 stars 32 forks source link

Can't add multiple clients #2

Closed MarvinMo closed 5 years ago

MarvinMo commented 6 years ago

I have downloaded scr-linux-patch.tgz and scr-client-cpp.tgz and unpacked them in TORCS directory. And do the order "sh do_patch.sh". But when I start a "Quick race", there is only one client named "scr_server 1" in the initializing screen. image

Are there any ideas with this problem? Thanks!

MarvinMo commented 6 years ago

And when I run "sh do_patch.sh", I got this:

sh do_patch.sh patching file doc/torcsdoc.conf Hunk #1 FAILED at 6. Hunk #2 FAILED at 38. Hunk #3 FAILED at 123. 3 out of 3 hunks FAILED -- saving rejects to file doc/torcsdoc.conf.rej patching file drivers/scr_server/0/car1-trb1.rgb patching file drivers/scr_server/0/default.xml patching file drivers/scr_server/0/Makefile patching file drivers/scr_server/1/car1-trb1.rgb patching file drivers/scr_server/1/default.xml patching file drivers/scr_server/1/Makefile patching file drivers/scr_server/2/car1-trb1.rgb patching file drivers/scr_server/2/default.xml patching file drivers/scr_server/2/Makefile patching file drivers/scr_server/3/car1-trb1.rgb patching file drivers/scr_server/3/default.xml patching file drivers/scr_server/3/Makefile patching file drivers/scr_server/4/car1-trb1.rgb patching file drivers/scr_server/4/default.xml patching file drivers/scr_server/4/Makefile patching file drivers/scr_server/5/car1-trb1.rgb patching file drivers/scr_server/5/default.xml patching file drivers/scr_server/5/Makefile patching file drivers/scr_server/6/car1-trb1.rgb patching file drivers/scr_server/6/default.xml patching file drivers/scr_server/6/Makefile patching file drivers/scr_server/7/car1-trb1.rgb patching file drivers/scr_server/7/default.xml patching file drivers/scr_server/7/Makefile patching file drivers/scr_server/8/car1-trb1.rgb patching file drivers/scr_server/8/default.xml patching file drivers/scr_server/8/Makefile patching file drivers/scr_server/9/car1-trb1.rgb patching file drivers/scr_server/9/default.xml patching file drivers/scr_server/9/Makefile patching file drivers/scr_server/CarControl.cpp patching file drivers/scr_server/CarControl.h patching file drivers/scr_server/Makefile patching file drivers/scr_server/ObstacleSensors.cpp patching file drivers/scr_server/ObstacleSensors.h patching file drivers/scr_server/scr_server.cpp patching file drivers/scr_server/scr_server.def patching file drivers/scr_server/scr_server.dsp patching file drivers/scr_server/scr_server.vcproj patching file drivers/scr_server/scr_server.xml patching file drivers/scr_server/sensors.cpp patching file drivers/scr_server/sensors.h patching file drivers/scr_server/SimpleParser.cpp patching file drivers/scr_server/SimpleParser.h patching file drivers/scr_server/WS2_32.Lib patching file interfaces/car.h Hunk #1 succeeded at 312 (offset 3 lines). Hunk #2 succeeded at 338 (offset 1 line). Hunk #3 succeeded at 348 (offset 1 line). Hunk #4 succeeded at 370 with fuzz 1 (offset 1 line). Hunk #5 succeeded at 462 (offset 59 lines). patching file libs/raceengineclient/raceengine.cpp Hunk #2 FAILED at 359. Hunk #3 FAILED at 387. 2 out of 3 hunks FAILED -- saving rejects to file libs/raceengineclient/raceengine.cpp.rej patching file libs/raceengineclient/raceengine.h patching file libs/raceengineclient/racemain.cpp Hunk #1 FAILED at 471. 1 out of 1 hunk FAILED -- saving rejects to file libs/raceengineclient/racemain.cpp.rej patching file libs/raceengineclient/racestate.cpp patching file libs/racescreens/driverselect.cpp Hunk #1 succeeded at 336 (offset -8 lines). patching file libs/tgf/tgf.cpp Hunk #2 FAILED at 364. 1 out of 2 hunks FAILED -- saving rejects to file libs/tgf/tgf.cpp.rej patching file libs/tgf/tgf.def Hunk #1 FAILED at 14. Hunk #2 FAILED at 53. 2 out of 2 hunks FAILED -- saving rejects to file libs/tgf/tgf.def.rej patching file libs/tgf/tgf.h Hunk #1 succeeded at 626 (offset 4 lines). patching file linux/main.cpp patching file linux/Makefile patching file linux/torcs patching file modules/simu/simuv2/carstruct.h patching file modules/simu/simuv2/collide.cpp Hunk #1 FAILED at 49. Hunk #2 FAILED at 135. Hunk #3 FAILED at 291. Hunk #4 FAILED at 413. 4 out of 4 hunks FAILED -- saving rejects to file modules/simu/simuv2/collide.cpp.rej patching file modules/simu/simuv2/engine.cpp patching file modules/simu/simuv2/simu.cpp Hunk #1 succeeded at 431 (offset 6 lines). patching file raceman/practice.xml Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file raceman/practice.xml.rej patching file raceman/quickrace.xml Hunk #1 succeeded at 14 with fuzz 2 (offset 13 lines). patching file tools/accc/accc patching file tools/nfs2ac/nfs2ac patching file tools/nfsperf/nfsperf patching file tools/texmapper/texmapper patching file tools/trackgen/trackgen patching file windows/main.cpp Hunk #1 FAILED at 34. 1 out of 1 hunk FAILED -- saving rejects to file windows/main.cpp.rej

Is this normal?

abhisheknaik96 commented 6 years ago

You have to add more cars using the 'Configure Race' setting in the GUI (Race -> Quick Race -> Configure Race). You can choose any type of track and add/remove different types of agents from there. The scr_server * agents are the ones you can control using external python scripts (like the ones provided in the repo), while the other cars are pre-programmed for racing behavior for the game.

Try it out, I hope this addresses your issue.

MarvinMo commented 6 years ago

@abhisheknaik96 thanks for your help! But I can only set players in the original menu (Configure Players). In 'Configure Race' setting (Race -> Quick Race -> Configure Race) I can only change tracks and there is no option for agent setting. image image If I press 'Accept', torcs will crash.

torcs Visual Properties Report

Compatibility mode, properties unknown. Robot Name=damned, path=Robots/index/0 Robot Name=damned, path=Robots/index/1 Robot Name=damned, path=Robots/index/2 Robot Name=damned, path=Robots/index/3 Robot Name=damned, path=Robots/index/4 Robot Name=damned, path=Robots/index/5 Robot Name=damned, path=Robots/index/6 Robot Name=damned, path=Robots/index/7 Robot Name=damned, path=Robots/index/8 Robot Name=damned, path=Robots/index/9 Robot Name=bt, path=Robots/index/0 Robot Name=bt, path=Robots/index/1 Robot Name=bt, path=Robots/index/2 Robot Name=bt, path=Robots/index/3 Robot Name=bt, path=Robots/index/4 Robot Name=bt, path=Robots/index/5 Robot Name=bt, path=Robots/index/6 Robot Name=bt, path=Robots/index/7 Robot Name=bt, path=Robots/index/8 Robot Name=bt, path=Robots/index/9 Robot Name=berniw, path=Robots/index/1 Robot Name=berniw, path=Robots/index/2 Robot Name=berniw, path=Robots/index/3 Robot Name=berniw, path=Robots/index/4 Robot Name=berniw, path=Robots/index/5 Robot Name=berniw, path=Robots/index/6 Robot Name=berniw, path=Robots/index/7 Robot Name=berniw, path=Robots/index/8 Robot Name=berniw, path=Robots/index/9 Robot Name=berniw, path=Robots/index/10 Robot Name=img_server, path=Robots/index/0 Robot Name=img_server, path=Robots/index/1 Robot Name=img_server, path=Robots/index/2 Robot Name=berniw3, path=Robots/index/1 Robot Name=berniw3, path=Robots/index/2 Robot Name=berniw3, path=Robots/index/3 Robot Name=berniw3, path=Robots/index/4 Robot Name=berniw3, path=Robots/index/5 Robot Name=berniw3, path=Robots/index/6 Robot Name=berniw3, path=Robots/index/7 Robot Name=berniw3, path=Robots/index/8 Robot Name=berniw3, path=Robots/index/9 Robot Name=berniw3, path=Robots/index/10 Robot Name=human, path=Robots/index/1 Robot Name=lliaw, path=Robots/index/1 Robot Name=lliaw, path=Robots/index/2 Robot Name=lliaw, path=Robots/index/3 Robot Name=lliaw, path=Robots/index/4 Robot Name=lliaw, path=Robots/index/5 Robot Name=lliaw, path=Robots/index/6 Robot Name=lliaw, path=Robots/index/7 Robot Name=lliaw, path=Robots/index/8 Robot Name=lliaw, path=Robots/index/9 Robot Name=lliaw, path=Robots/index/10 Robot Name=scr_server, path=Robots/index/0 Robot Name=scr_server, path=Robots/index/1 Robot Name=scr_server, path=Robots/index/2 Robot Name=scr_server, path=Robots/index/3 Robot Name=scr_server, path=Robots/index/4 Robot Name=scr_server, path=Robots/index/5 Robot Name=scr_server, path=Robots/index/6 Robot Name=scr_server, path=Robots/index/7 Robot Name=scr_server, path=Robots/index/8 Robot Name=scr_server, path=Robots/index/9 Robot Name=inferno, path=Robots/index/1 Robot Name=inferno, path=Robots/index/2 Robot Name=inferno, path=Robots/index/3 Robot Name=inferno, path=Robots/index/4 Robot Name=inferno, path=Robots/index/5 Robot Name=inferno, path=Robots/index/6 Robot Name=inferno, path=Robots/index/7 Robot Name=inferno, path=Robots/index/8 Robot Name=inferno, path=Robots/index/9 Robot Name=inferno, path=Robots/index/10 Robot Name=tita, path=Robots/index/1 Robot Name=tita, path=Robots/index/2 Robot Name=tita, path=Robots/index/3 Robot Name=tita, path=Robots/index/4 Robot Name=tita, path=Robots/index/5 Robot Name=tita, path=Robots/index/6 Robot Name=tita, path=Robots/index/7 Robot Name=tita, path=Robots/index/8 Robot Name=tita, path=Robots/index/9 Robot Name=tita, path=Robots/index/10 Robot Name=olethros, path=Robots/index/0 Robot Name=olethros, path=Robots/index/1 Robot Name=olethros, path=Robots/index/2 Robot Name=olethros, path=Robots/index/3 Robot Name=olethros, path=Robots/index/4 Robot Name=olethros, path=Robots/index/5 Robot Name=olethros, path=Robots/index/6 Robot Name=olethros, path=Robots/index/7 Robot Name=olethros, path=Robots/index/8 Robot Name=olethros, path=Robots/index/9 Robot Name=berniw2, path=Robots/index/1 Robot Name=berniw2, path=Robots/index/2 Robot Name=berniw2, path=Robots/index/3 Robot Name=berniw2, path=Robots/index/4 Robot Name=berniw2, path=Robots/index/5 Robot Name=berniw2, path=Robots/index/6 Robot Name=berniw2, path=Robots/index/7 Robot Name=berniw2, path=Robots/index/8 Robot Name=berniw2, path=Robots/index/9 Robot Name=berniw2, path=Robots/index/10 Robot Name=inferno2, path=Robots/index/1 Robot Name=inferno2, path=Robots/index/2 Robot Name=inferno2, path=Robots/index/3 Robot Name=inferno2, path=Robots/index/4 Robot Name=inferno2, path=Robots/index/5 Robot Name=inferno2, path=Robots/index/6 Robot Name=inferno2, path=Robots/index/7 Robot Name=inferno2, path=Robots/index/8 Robot Name=inferno2, path=Robots/index/9 Robot Name=inferno2, path=Robots/index/10 Robot Name=sparkle, path=Robots/index/0 Robot Name=sparkle, path=Robots/index/1 Robot Name=sparkle, path=Robots/index/2 Robot Name=sparkle, path=Robots/index/3 Robot Name=sparkle, path=Robots/index/4 Robot Name=sparkle, path=Robots/index/5 Robot Name=sparkle, path=Robots/index/6 Robot Name=sparkle, path=Robots/index/7 Robot Name=sparkle, path=Robots/index/8 Robot Name=sparkle, path=Robots/index/9 /usr/local/bin/torcs: line 53: 28113 Segmentation fault (core dumped) $LIBDIR/torcs-bin -l $LOCAL_CONF -L $LIBDIR -D $DATADIR $*

abhisheknaik96 commented 6 years ago

Well, after you choose the track and press 'Accept', you should ideally see the next screen with the option to add/remove cars. torcs_agents

Can you mention what system configuration you have, as well as the version of TORCS you're using?

MarvinMo commented 6 years ago

I'm using torcs 1.3.7, Ubuntu 16.04.4.
Linux kernel version is 4.13.0-37-generic. gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) plib version is 1.8.5-7 libopenal-dev version is 1:1.16.0-3 libpng12-dev version is 1.2.54-1ubuntu1 zlib1g-dev version is 1:1.2.8.dfsg-2ubuntu4.1 libogg-dev version is 1.3.2-1 libvorbis-dev version is 1.3.5-3ubuntu0.2

glxinfo | grep OpenGL: OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.2.8 OpenGL core profile shading language version string: 4.50 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.0 Mesa 17.2.8 OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.2.8 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10 OpenGL ES profile extensions:

Do you need other configurations? @abhisheknaik96

MarvinMo commented 6 years ago

I'm wondering that whether my install package is complete. Because some error occured when I tried to do the patch. Could you please send me your install package which has already been patched?

abhisheknaik96 commented 6 years ago

I think the patch isn't being installed properly.

  1. First of all, try to perform a clean install of TORCS and the patch as per the instructions in the README.
  2. If that doesn't work, can you try out the TORCS from this project? (Beware, the zip is quite big). It's version 1.3.6, on which the patch is working smoothly.
suraj2596 commented 5 years ago

I'm facing the same issue. And when I run make -j4 after configuring it, I'm getting a different kind of error though I'm able to run torcs sim.

And when I run "sh do_patch.sh", I got this:

sh do_patch.sh patching file doc/torcsdoc.conf Hunk #1 FAILED at 6. Hunk #2 FAILED at 38. Hunk #3 FAILED at 123. 3 out of 3 hunks FAILED -- saving rejects to file doc/torcsdoc.conf.rej patching file drivers/scr_server/0/car1-trb1.rgb patching file drivers/scr_server/0/default.xml patching file drivers/scr_server/0/Makefile patching file drivers/scr_server/1/car1-trb1.rgb patching file drivers/scr_server/1/default.xml patching file drivers/scr_server/1/Makefile patching file drivers/scr_server/2/car1-trb1.rgb patching file drivers/scr_server/2/default.xml patching file drivers/scr_server/2/Makefile patching file drivers/scr_server/3/car1-trb1.rgb patching file drivers/scr_server/3/default.xml patching file drivers/scr_server/3/Makefile patching file drivers/scr_server/4/car1-trb1.rgb patching file drivers/scr_server/4/default.xml patching file drivers/scr_server/4/Makefile patching file drivers/scr_server/5/car1-trb1.rgb patching file drivers/scr_server/5/default.xml patching file drivers/scr_server/5/Makefile patching file drivers/scr_server/6/car1-trb1.rgb patching file drivers/scr_server/6/default.xml patching file drivers/scr_server/6/Makefile patching file drivers/scr_server/7/car1-trb1.rgb patching file drivers/scr_server/7/default.xml patching file drivers/scr_server/7/Makefile patching file drivers/scr_server/8/car1-trb1.rgb patching file drivers/scr_server/8/default.xml patching file drivers/scr_server/8/Makefile patching file drivers/scr_server/9/car1-trb1.rgb patching file drivers/scr_server/9/default.xml patching file drivers/scr_server/9/Makefile patching file drivers/scr_server/CarControl.cpp patching file drivers/scr_server/CarControl.h patching file drivers/scr_server/Makefile patching file drivers/scr_server/ObstacleSensors.cpp patching file drivers/scr_server/ObstacleSensors.h patching file drivers/scr_server/scr_server.cpp patching file drivers/scr_server/scr_server.def patching file drivers/scr_server/scr_server.dsp patching file drivers/scr_server/scr_server.vcproj patching file drivers/scr_server/scr_server.xml patching file drivers/scr_server/sensors.cpp patching file drivers/scr_server/sensors.h patching file drivers/scr_server/SimpleParser.cpp patching file drivers/scr_server/SimpleParser.h patching file drivers/scr_server/WS2_32.Lib patching file interfaces/car.h Hunk #1 succeeded at 312 (offset 3 lines). Hunk #2 succeeded at 338 (offset 1 line). Hunk #3 succeeded at 348 (offset 1 line). Hunk #4 succeeded at 370 with fuzz 1 (offset 1 line). Hunk #5 succeeded at 462 (offset 59 lines). patching file libs/raceengineclient/raceengine.cpp Hunk #2 FAILED at 359. Hunk #3 FAILED at 387. 2 out of 3 hunks FAILED -- saving rejects to file libs/raceengineclient/raceengine.cpp.rej patching file libs/raceengineclient/raceengine.h patching file libs/raceengineclient/racemain.cpp Hunk #1 FAILED at 471. 1 out of 1 hunk FAILED -- saving rejects to file libs/raceengineclient/racemain.cpp.rej patching file libs/raceengineclient/racestate.cpp patching file libs/racescreens/driverselect.cpp Hunk #1 succeeded at 336 (offset -8 lines). patching file libs/tgf/tgf.cpp Hunk #2 FAILED at 364. 1 out of 2 hunks FAILED -- saving rejects to file libs/tgf/tgf.cpp.rej patching file libs/tgf/tgf.def Hunk #1 FAILED at 14. Hunk #2 FAILED at 53. 2 out of 2 hunks FAILED -- saving rejects to file libs/tgf/tgf.def.rej patching file libs/tgf/tgf.h Hunk #1 succeeded at 626 (offset 4 lines). patching file linux/main.cpp patching file linux/Makefile patching file linux/torcs patching file modules/simu/simuv2/carstruct.h patching file modules/simu/simuv2/collide.cpp Hunk #1 FAILED at 49. Hunk #2 FAILED at 135. Hunk #3 FAILED at 291. Hunk #4 FAILED at 413. 4 out of 4 hunks FAILED -- saving rejects to file modules/simu/simuv2/collide.cpp.rej patching file modules/simu/simuv2/engine.cpp patching file modules/simu/simuv2/simu.cpp Hunk #1 succeeded at 431 (offset 6 lines). patching file raceman/practice.xml Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file raceman/practice.xml.rej patching file raceman/quickrace.xml Hunk #1 succeeded at 14 with fuzz 2 (offset 13 lines). patching file tools/accc/accc patching file tools/nfs2ac/nfs2ac patching file tools/nfsperf/nfsperf patching file tools/texmapper/texmapper patching file tools/trackgen/trackgen patching file windows/main.cpp Hunk #1 FAILED at 34. 1 out of 1 hunk FAILED -- saving rejects to file windows/main.cpp.rej

Is this normal?

suraj2596 commented 5 years ago

You might have already found this repo. If not or for future others who might face issues regarding patching or any other issues, refer this repo. It consists of patched package of v1.3.7.

I'm wondering that whether my install package is complete. Because some error occured when I tried to do the patch. Could you please send me your install package which has already been patched?

abhisheknaik96 commented 5 years ago

A few 'HUNK's might fail here and there without affecting the installation. Do try playing the game or running the sample code. If that fails, then you might have to re-look at the versions and dependencies to make sure your configuration is fine. Hope that helps!

suraj2596 commented 5 years ago

Able to play the game. But when I make after patching, it's throws this error:


... -o torcs-bin
main.o: In function `main':
main.cpp:(.text.startup+0x32): undefined reference to `setVersion(char*)'
main.cpp:(.text.startup+0x27e): undefined reference to `setTimeout(long)'
main.cpp:(.text.startup+0x31b): undefined reference to `setVersion(char*)'
main.cpp:(.text.startup+0x320): undefined reference to `getVersion()'
main.cpp:(.text.startup+0x40c): undefined reference to `setDamageLimit(bool)'
main.cpp:(.text.startup+0x440): undefined reference to `setFuelConsumption(bool)'
main.cpp:(.text.startup+0x479): undefined reference to `setLaptimeLimit(bool)'
collect2: error: ld returned 1 exit status

...torcs-1.3.7/Make-default.mk:405: recipe for target 'torcs-bin' failed
make[3]: *** [torcs-bin] Error 1
.
.
.

Looks like the compilation of few files must be made first before anything.

And the agents named scp_server * didn't showing up.

abhisheknaik96 commented 5 years ago

In that case, the patch hasn't happened properly. Can you download and use the TORCS version from this project as mentioned in the Readme? Applying the patch on that should work.

MehaKaushik commented 5 years ago

@suraj2596 may be you can use this repo : https://github.com/madras-simulator/TORCS Patch is already applied in this one.

suraj2596 commented 5 years ago

Thanks @abhisheknaik96, @MehaKaushik, I tried the patched repos and was able to work on it. But I was wondering what might have caused this 'hunk fail' problem. And probably discuss on how to fix this.

abhisheknaik96 commented 5 years ago

We don't really know the cause of that yet. If you find something, do let us know as well! :)