gerkone / pyTORCS-docker

Docker-based, gym-like torcs environment with vision.
17 stars 3 forks source link

Add an opponents #1

Open PazAranyi opened 2 years ago

PazAranyi commented 2 years ago

Hi,

First of all, great work!

I want to try some tracking algorithms, and to do so, I want to add opponents to the race, but I couldn't find a way to do that. Can you help me?

gerkone commented 2 years ago

Hey

To start a race torcs load a "raceman" config file. This can be done through command line with the -r option

torcs -r [your config]

At the moment if no config is specified torcs falls back to practice (what is currently used).

If you want to add opponents you can do so by editing the quickrace.xml config file to include more opponents (add other drivers besides scr_server inside <section name="Drivers">). Please note that I left only 'berniw' as CPU driver, you could add more and rebuild the container if you want. After editing quickrace you would need to run torcs with it as a config file. Add -r config/raceman/quickrace.xml to the run torcs run command (you could even make this a simulation parameter) https://github.com/gerkone/pyTORCS-docker/blob/01bfb15005b2d940f315a03b7dec20a68b0e92d9/driver/torcs_client/utils.py#L102


As of now I cannot work on this project. It was part of my bachelor thesis but I no longer have time for it. If you need some suggestions I can help though, and if you manage to get it working and pull request I’ll merge.