GithubHelp home page GithubHelp logo

sg774 / bugs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from izzystardust/bugs

0.0 0.0 0.0 54.66 MB

ROS package implementing bug 0, 1, and 2 in Python

License: MIT License

CMake 23.66% Makefile 35.45% C 5.63% C++ 6.60% Shell 6.86% Python 21.79%

bugs's Introduction

Bug Algorithms for ROS

Dependencies:

  • None

Running:

rosrun bugs bug.py bug[0|1|2] destX destY

where 0, 1, or 2 is the bug algorithm of interest.

Stage should be running before the bug program is deployed.

Known bugs:

  • In some cases, can hit corner of obstacle without detection.
  • A case in wall following can lead to the robot sitting in a corner and twitching. A literal corner case, if you will.
  • Not well tested for other corner cases. Shit's weird, yo.

Analysis:

Bug0:

Memory: O(1) - at each step, the robot knows only its current state and the sensor readings. CPU: - at each step, constant time. Steps: best, O(d), where d is distance. Worst case, nonterminating - can get stuck.

Bug1:

Memory: O(1) CPU: at each step, constant time Steps: best, O(d), worst O(D+1.5*total_perimeter)

Bug2:

Memory: O(1) CPU: at each step, constant time Steps: best, O(d), worst O(D+0.5 * num_obstacles * total_perimeter)

Evaluation:

The three bug algorithms differ only in how they decide to leave the wall and return to the path through free space to the goal. To implement this, a single Bug class was created that contained all of the shared logic of the bug algorithms, with the main loop: while current_location.distance(tx, ty) > delta: hit_wall = bug.go_until_obstacle() if hit_wall: bug.follow_wall() print "Arrived at", (tx, ty)

where follow_wall() loops until bug.should_leave_wall() is true.

Bug0 implements logic to see if the path in the direction of the goal is clear. Bug1 implements logic to confirm circumnavigation occured and the robot is at the closest point. Bug2 implements logic to see if the slope of the line to the destination is the same as the slope at impact and the current position is closer.

bugs's People

Contributors

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