beaupranisaa / NEATRocket

Training a rocket controller using the NEAT algorithm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NEATRocket

gif Training a rocket controller using the NEAT algorithm.

Dependencies:

  1. pymunk 5.7.0
  2. pyglet 1.5.7
  3. neat-python 0.92

Usage:

  • Manually control the rocket with your arrow keys.
$ python3 manual.py
  • Train the network
$ python3 train.py <name of the directory to save the neural networks to (optional)>

#Example
$ python3 train.py networks/
  • Automatic rocket control
$ python3 auto.py <neural network files (optional)> 

# Example:
$ python3 auto.py networks/* networks2/Net_0.p
  • Remove all networks
$ bash clear.sh

NEAT Setup

  • States/Input:
    • x error = current x position - desired x position
    • y error = current y position - desired y position
    • a error = current angular position - desired angular position
    • vx error = current x velocity - desired x velocity
    • vy error = current y velocity - desired y velocity
    • va error = current angular velocity - desired angular velocity
  • Output:
    • longitudinal propulsion states: clamped [-1,+1]
    • top lateral propulsion states: clamped [-1,+1]
    • bottom lateral propulsion states: clamped [-1,+1]
  • fitness function : Summation of weighted squared errors of the positional states across time

Contributors:

  • Rom Parnichkun
  • Pranisaa Charnparttaravanit
  • Sitiporn Sae Lim

About

Training a rocket controller using the NEAT algorithm.


Languages

Language:Python 99.7%Language:Shell 0.3%