The repository contains code used for my Master's thesis (Teo, 2023, "Recurrent Soft Actor-Critic (RSAC) Algorithm for Pedestrian Collision Avoidance in Occlusion Scenarios," Universiti Sains Malaysia, School of Computer Sciences, supervised by Dr. Fadratul Hafinaz Hassan).
If you are using the software, please cite it using this metadata.
An environment for urban area autonomous driving and decision-making - extended and modified from highway-env.
- Roadside obstacles
- Pedestrians cross the road
- Pedestrian collision avoidance
- Navigation
- Install highway-env via pip for all dependencies.
pip install highway-env==1.8.1
- Clone the repository.
git clone https://github.com/kengboon/RoadEnv.git
# Register environment
from road_env import register_road_envs
register_road_envs()
# Make environment
import gymnasium as gym
env = gym.make('urban-road-v0', render_mode='rgb_array')
# Configure parameters (example)
env.configure({
"random_seed": None,
"duration": 60,
})
obs, info = env.reset()
# Graphic display
import matplotlib.pyplot as plt
plt.imshow(env.render())
# Execution
done = truncated = False
while not (done or truncated):
action = ... # Your agent code here
obs, reward, done, truncated, info = env.step(action)
env.render() # Update graphic
See more examples.
- Documentation of highway-env
- Implementation of RL algorithms by @quantumiracle
View CITATION.cff.
@software{Teo_RoadEnv,
author = {Teo, Keng Boon},
license = {MIT},
title = {{RoadEnv}},
url = {https://github.com/kengboon/RoadEnv}
}