Skip to content

A simple to set up 2D automated vehicle gym env featuring random problem generation and dynamic observations.

Notifications You must be signed in to change notification settings

m-schier/CarEnv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CarEnv

Easy to use gym-Environment for 2D vehicle simulations using dynamic scenes.

Racing scenario

Navigating a randomly generated tightly winding road at speed. The simulated vehicle uses a dynamic single track model with a coupled Dugoff tire model. Throttle, brake and steering are continuous actions, with the vehicle by default using front wheel drive. The agent may learn to control brake balance by applying throttle and brake individually.

Video of agent on country road environment

Parking scenario

Parallel parking in reverse using a kinematic model. Steering and acceleration (positive through negative) are continuous actoins.

Video of agent on parking environment

Installation

To install the latest version, simply run:

pip install git+https://github.com/m-schier/CarEnv

You may then create a new gym environment, e.g. on the racing configuration:

from CarEnv import CarEnv, Configs

env = CarEnv(Configs.get_standard_env_config("racing"))

However, if you want to modify the environment or run any of our example scripts it may be more convenient to clone this repository and then install using local linking:

pip install -e .

Running as human

Execute scripts/run_human.py. The agent may be controlled by keyboard or by a joystick or steering wheel if present. You may have to modify the axis and button numbers when using a controller, see the implementation in CarEnv/Actions/ for available keyword arguments.

Training a Soft Actor-Critic agent

In scripts/train_sac.py you may find an example script on how to train a Soft Actor-Critic using a Deep Set feature extractor on the parking and racing configurations. This implementation uses the Stable Baselines 3 library. You must install the reinforcement learning extra requirements, i.e.:

pip install -e .[RL]

Citing

If you find this environment useful, you may cite it by our paper in which it was initially presented:

@inproceedings { SchRei2023b,
  author = {Schier, Maximilian and Reinders, Christoph and Rosenhahn, Bodo},
  title = {Learned Fourier Bases for Deep Set Feature Extractors in Automotive Reinforcement Learning},
  booktitle = {2023 IEEE 26th International Conference on Intelligent Transportation Systems (ITSC)},
  year = {2023},
  pages = {931-938},
  doi = {10.1109/ITSC57777.2023.10422233}
}

About

A simple to set up 2D automated vehicle gym env featuring random problem generation and dynamic observations.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages