GithubHelp home page GithubHelp logo

taka-rl / rl_aps Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.01 MB

This repository is a development environment for my thesis which is "Reinforcement learning based automated parking systems".

Python 100.00%
gymnasium-environment reinforcement-learning self-driving-car automatic-parking autonomous-parking autopark kinematic-bicycle-model python python3 automated-parking-systems rayrllib

rl_aps's Introduction

RL_APS

This repository is a development environment for my thesis which is "Reinforcement learning based automated parking systems". It provides the training envrionment for the agent in both parallel and perpendicular parkings.

Folder structure

  • sim_env: contains the necessary scripts for the parking simulation
    • parking_env.py: environment class
    • car.py: car class
    • com_fcn.py: common functions
    • parameters.py: parameters for the simulation environment
    • init_state.py: initialize the car/parking lot location and heading angle for the training
  • training: contains the script for the training
    • training.py: for the training
    • utility.py: useful functions for the training
  • practice_rllib: to learn how to use Ray RLlib for my thesis
  • practice_pygame: to learn how to draw the parking environment for my thesis

Simulation Environment

  • Python
  • Gymnasium
  • Ray RLlib

Kinematic Bicycle model

  • Kinematic bicycle model equation

      x_dot = v * np.cos(ψ)
      y_dot = v * np.sin(ψ)
      v_dot = a
      psi_dot = v * np.tan(delta) / CAR_L
    

    v: velocity, ψ(psi): heading angle of the car, a: acceleration, δ(delta): steering angle, CAR_L: car length
    x: the center of the car position in x axle, y: the center of the car position in y axle

Reinforcement learning

Environment

This environment provides Parallel and Perpendicular parking.

Action type

There are two action types which are continuous and discrete.
Actions as input values for the agent are [a, δ] in both type.

  • continuous
    a is acceleration, limited between -1 and 1 m/s^2 δ is set between -pi/4〜pi/4
  • discrete Action space is 6.
    0: [1, 0] # move forward
    1: [1, -np.pi/6] # move right forward
    2: [1, np.pi/6] # move left forward
    3 :[-1, 0] # move backward
    4 :[-1, -np.pi/6] # move right backward
    5 :[-1, np.pi/6] # move left backward

State value for the agent

Output values of the algorithm are v, and the distance between the 4 parking corner points(x,y) and the center position of the car(x,y).
(v is divided by the maximum velocity and the disance is divided by the maximaum distance for normalization.) Maximum velocity is +/-10km/h and Maximum distance is 25m.

Reward type

If the car parks in the parking lot succesfully, the reward +1 is given.
The reward -1 is given if the following conditions are met.

  • the car get collision.
  • the distance between the car and the parking lot is more than 25meters.
  • the car crosses the parking lot border horizontally/vertically.

How to use

Training

Visualize the agent

rl_aps's People

Contributors

taka-rl avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

rl_aps's Issues

improvements for the future

Making the initial position process more independent and readable for both parallel and perpendicular parkings, it would be nice to make two classes such as parallel and perpendicular.
Each class has functions for the initial positions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.