Giter Site home page Giter Site logo

obstacle-avoidance-using-a-genetic-algorithm's Introduction

Obstacle Avoidance Using A Genetic Algorithm (Requires CoppeliaSim for the simulations)

Robots that learn how to avoid obstacles using a genetic algorithm. There are 12 robots in total, spread over 3 obstacle courses. At the beginning of the simulation each robot gets a genome generated at random, the values of which drive the robot wheels. In each generation the robots calculate how many times they've colided with an obstacle and compare that with the distance the robot has travelled using the formula1:

equation

The displacement/distance value is taken every 0.2 distance units. The best few robots' genomes are kept for the next generation but the rest of them are paired and modified2 (crossover, mutation). Each generation/epoch lasts for 10 minutes.

The 'Script' folder contains3:

  1. The main script which is responsible for starting and ending each epoch, calculating the fitness of every robot and generating the new genomes
  2. The robot script which each robot possesses, counts collisions, distance and moves the robot using the gene values
  3. The robot script for testing the best performing genome

This algorithm was developed as an assigment during an undergrad Robotics course.


1 The formula is derived in part from https://doi.org/10.1016/j.procs.2016.05.404

2 The position at which the two genomes are seamed is chosen at random, its gene values are chosen using a formula from https://laboratoriomatematicas.uniandes.edu.co/metodos/contenido/contenido/s5a.pdf. 20% of the population of genomes are point mutated (only a single value -for both wheels- in the genome is mutated)

3 The Script folder is put here for convienience only, the actual scripts are in the CoppeliaSim files

obstacle-avoidance-using-a-genetic-algorithm's People

Contributors

stefankanan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.