This project was made for the scale racing team at the University of Toronto. The club aims to build a small autonomous car, similar to the F10th competitions. A part of developing the software/autonomy side of the project is selecting and testing reinforcement learning algorithms for controlling the vehicle. Training RL policies in real time on physical hardware is difficult and time consuming. The aim of this simulator is to give a platform for experimenting with policies and learning more about RL strategies that might be useful for the physical car.
- PyBullet: acts as the physics simulator and rendering environment for this simulated race track.
- Gymnasium (similar to OpenAI Gym) provides a uniform inferface for RL tools.
I recommend using a python package manager such as Micromamba or conda to create an isolated environment.
pip install gymnasium
to install the custom package containing the gym environment, you need to run:
pip install -e gym_envsThis -e uses editable mode, which allows you to modify the package without having to call this every time you make a change.
you must download pybullet
Used for finding contours of shapes
This is used for interpolation along paths.
- gym-envs contains the gym environment definition
- construct_environment.py provides the code for setting up the world and spawning in the track.
- racing_env.py contains the majority of the environment definition, such as the step function etc.
- the urdf files contain robot definitions for the cars. see the source.
- manual_control.py allows you to drive the car manually
- train.py allows you to run a policy. Currently uses proportional controller logic.
- tracks contains the object files for the tracks. Note that there must be an inner and outer track provided.