Giter Site home page Giter Site logo

yamashirohermit / bug-algorithms-simulation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohammadhashemii/bug-algorithms-simulation

0.0 0.0 0.0 7.51 MB

Python implementation of Bug algorithms on 3-wheel omnidirectional and Webots simulation.

Python 100.00%

bug-algorithms-simulation's Introduction

Bug-Algorithms-Simulation

This is the course final project of the Fundamental of Robotics - Fall 2021 course at Shahid Beheshti University. This repository contains the Python implementation of Bug algorithms and simulation with 3-wheel omnidirectional robot in Webots simulation software.

Introduction to Bug algorithms

The Bug algorithm is perhaps the simplest obstacle-avoidance algorithm one could imagine. The basic idea is to follow the contour of each obstacle in the robot’s way and thus circumnavigate it. A number of variations and extensions of the Bug algorithm exist, otherwise we have implemented the three main ones in Python.

  • Bug 0: With Bug0, the robot begins to follow the object’s contour, but departs immediately when it is able to move directly toward the goal. In general this algorithm does not guarantees that the robot reach the goal.

  • Bug 1: With Bug1, the robot fully circles the object first, then departs from the point with the shortest distance toward the goal. This approach is, of course, very inefficient but it guarantees that the robot will reach any reachable goal.

  • Bug 2: With Bug2 the robot begins to follow the object’s contour, but departs immediately when it is able to move directly(on M-line) toward the goal. In general this improved Bug algorithm will have significantly shorter total robot travel. However, one can still construct situations in which Bug2 is arbitrarily inefficient.

You can see the behavior of simple Bug Algorithms here:

Implementation

We have implemented the three main bug algorithms in Python. Additionally, we simulated these algorithms on 3-wheel omnidirectional robot using Webots.

If your are just interested in controllers, there are three distinct Python files which bug algorithms have been coded there. The conrollers are in : SBU_omni_robot/controllers/final_controller/.

Algorithm Controller
Bug 0 BUG0_controller.py
Bug 1 BUG1_controller.py
Bug 2 BUG2_controller.py

Simulation

The simulation results in Webots are as follows. Also you can watch the full videos of the simulations here: Simulation Videos


Bug 0 snapshots:


Bug 1 snapshots:


Bug 2 snapshots:

How to run

For simulation, you need to install Webots software on your system. After installing Webots:

1. clone the repository
2. open /SBU_omni_robot project in Webots
3. Run and Happy Simulation!

State diagrams

For better intuition, we also plot the state diagram of these three main bug algorithms:

bug-algorithms-simulation's People

Contributors

mohammadhashemii 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.