Code Monkey home page Code Monkey logo

vector-field-histogram's Introduction

Vector Field Histogram

Build Status

This is an incomplete implementation of the Vector Field Histogram algorithm, developed by J. Borenstein and Y. Koren in 1990. Recently I got some motivation to study robotics once again and decided it was time to finally "finish" this code.

I originally used this library in a project for my real-time systems class at Embry-Riddle Aeronautical University when I was studying in the US.

Eventually, I'll add support to the VFH+ and VFH-star algorithms.

How to install

Building the software should be as easy as:

git clone https://github.com/agarie/vector-field-histogram.git
cd vector-field-histogram
make

I'm not working on using autotools for the moment (I need to learn how to use it, to be honest...). For now, it's possible to compile a program with the object file vfh.o. The example create_histogram_grid(see Makefile) does exactly that.

The VFH algorithm

The VFH algorithm receives as inputs an array of rangefinder sensor readings and generates control signals -- the "best" direction and a damping factor for the max velocity of the robot.

The sensor readings are mapped into the Histogram Grid, a large matrix in which each cell corresponds to an obstacle density in that area. Sonars and laser rangefinders return a direction and a distance, so there must be a conversion from polar to rectangular coordinates before processing them. The correspondence between real world coordinates (i.e. (x, y)) and grid coordinates (i.e. (i, j)) is given by a resolution parameter, which is the size of the cells, such that (x, y) is in cell (i, j) if x is in [i * resolution, (i + 1) * resolution] and j is in [j * resolution, (j + 1) * resolution]. Each reading in a cell increases that cell's density by 1.

With the histogram grid in place, actual path planning can begin. A square moving window centered around the robot is picked and each of its cells is mapped to (m_ij, beta_ij); m is a function of the obstacle density of the cell and its distance to the robot, and beta is the angular position of the cell. The polar histogram separates the cells in n = 360/alpha sectors. Each sector k has value M_k = sum(m_ij for (i, j) in sector_k). The moving window is used to avoid computing on all cells (the histogram grid can be huge) and because cells too far away probably won't contribute much to local planning.

A threshold is applied to the polar histogram, selecting only the sectors with obstacle density low enough for safe passage. Finally, the sector with the direction best matching the objective's is followed. The max velocity S_max is decreased depending on the density of the chosen sector and the current angular velocity.

License

Copyright (c) 2012-2016 Carlos Agarie. See LICENSE for details.

vector-field-histogram's People

Contributors

agarie avatar dmamylin 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.