Rally Racer
This repository holds a sandbox driving simulation controllable via a network interface as a machine learning and data collection challenge.
Installation
From the root of the repository, run
uv sync
To run the game, you can use
uv run main.py
Generality
Launching main.py starts a race with a single car on the provided track.
This track can be controlled either by keyboard (WASD) or by a socket interface.
An example of such interface is included in the code in scripts/recorder.py. To run it, simply use the following command:
uv run -m scripts.recorder
Sensing
The car sensing is available in two commodities: raycasts and images. These sensing snapshots are sent at 10 Hertz (i.e. 10 times a second). Due to this fact, correct reception of snapshot messages has to be done regularly.
Communication protocol
A remote controller can be impemented using TCP socket connecting on localhost on port 5000. Different commands can be issued to the race simulation to control the car.
These commands are declared in src/command.py
Car controls
ControlCommand(control: CarControl, active: bool)
To simulate key press and control the car.
Controls
- W Move forward
- S Brake / move backward
- A Turn left
- D Turn right
- F Toggle FPS indicator
- V Toggle speedometer
- R Reset car
- C Toggle raycasts visibility
- Esc Quit
Credits
This project is based on the repository https://github.com/ISC-HEI/RallyRobotPilot_2025, which is in turn based on https://github.com/mandaw2014/Rally
