Code Monkey home page Code Monkey logo

wall_follower's Introduction

wall_follower

Following Walls In order to follow walls, you need at least two sensors (2 bits of information) to handle the four potential situations the robot could be in. One sensor has to be in the front, and the second could be on the left or right of the robot. The more sensors you use, the more information you have, so you can make better judgements about what is going on. For this example, I just used two. The robot cannot find the wall, so you have to place the robot next to the wall. If you placed it in the middle of the room, it would just drive in circles.

Truth Table Front Sensor Right Sensor Situation Action Off Off Robot is driving away from wall. Come back to wall, turn right. On Off Robot is away from wall but headed towards a wall or obstacle. Turn hard left to get back parallel with the wall. Off On Robot is following the wall. Drive forward. On On The robot is at a corner. Turn hard left. In order to work, I had to add code to turn hard left. Hard left just means I only turn on the right wheel so the robot basically turns in place rather than continue to move forward while turning. I couldn't just turn slowly like the line follower because you have no idea how close the robot is to the wall. This is a limitation of the sensor I chose, because the sensor reflects differently based on the surface. Additionally, the logic is set up to only be binary because there is no way to tell the distance based on the sensor. If you knew distance, you could add additional logic to vary the speed based on the distance to make the robot travel around the room faster. I actually couldn't get the sensor to reflect at all off a black surface, so in the video you'll see I had to put a white surface in front of the dishwasher.

wall_follower's People

Contributors

19andy 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.