GithubHelp home page GithubHelp logo

erdenezul / virtualalvinn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xissburg/virtualalvinn

0.0 2.0 0.0 3.44 MB

Virtual Autonomous Landing Vehicle In a Neural Network

License: MIT License

C 20.95% C++ 78.47% Objective-C 0.30% Objective-C++ 0.28% Rich Text Format 0.01%

virtualalvinn's Introduction

Virtual Alvinn

ALVINN (Autonomous Landing Vehicle In a Neural Network) is a project developed in 1996 by Dean A. Pormeleau et al where the aim was to make an autonomous car driven by a neural network solely based on the images captured by a camera mounted on the top of the vehicle. They were pretty successful, achieving a record for a vehicle driven on the road by a computer for several kilometers and their system was capable of driving the vehicle in different kinds of roads (pavement, dirt, etc).

VirtualAlvinn

Virtual Alvinn is an implementation of the same idea in a 3D virtual world. For the physics simulation the Bullet Physics engine is employed, with its Raycast Vehicle. For gamepad input support SDL is used. The FANN (Fast Artificial Neural Network) library is employed to implement the ANN. OpenGl is used for graphics.

The image of the camera is draw in an off-screen buffer using a Framebuffer Object (FBO), which is exactly the image in the little square on the bottom left corner of the screen. In capture mode the contents of this FBO is stored in an array. In training mode all the data that was captured is given to FANN for it to train the ANN. In ANN mode the ANN drives the vehicle.

Building and running

Everything this project needs to build is included. However, you may get the following error in the Xcode's output when trying to run the project:

dyld: Library not loaded: @executablepath/../Frameworks/SDL.framework/Versions/A/SDL Referenced from: /Users/xissburg/Library/Developer/Xcode/DerivedData/VirtualAlvinn-albzrxerrqqgdxahsvcjjylywjad/Build/Products/Debug/VirtualAlvinn.app/Contents/MacOS/VirtualAlvinn Reason: image not found

That means you don't have the SDL.framework installed in your system. To install it, simply copy the SDL.framework folder to /Library/Frameworks. You can do that by running the following command while in the root directory of this project:

sudo cp -rf Frameworks/SDL.framework /Library/Frameworks/

How to play with it

It is highly recommend that you use a gamepad with an analog stick to control the vehicle, because the ANN matches the steering angle with the image from the virtual camera. Anyway, you can also control it with the keyboard arrow keys.

First, drive a little to get used to that car. It is quite unstable in high speeds then, be careful or you may hurt yourself. Also, make sure you are not drunk before driving it. Place your car on the road and press the Toggle Image Capture button to start capturing and storing the images along with the car state (steering angle and speed), and keep driving. Watch the console for useful information, like how many samples you have already taken. When you're done, press the Toggle Image Capture button again to stop capturing and press the Train ANN button to train the neural network. Watch the console for the training status. When done, put you car back on the road and press the Toggle Driver button to put the ANN to work. The wheels should turn blue to indicate the ANN is driving. If the ANN goes crazy and get stuck, press the Toggle Driver button again to take control of the car, put it back to the center of the road, and press the Toggle Driver button again to allow the ANN to drive.

Gamepad

The following image contains the gamepad configuration for my gamepad (Logitech Cordless Rumblepad 2). I don't know how it will match other gamepads.

Logitech Cordless Rumblepad 2

Keyboard

To control the vehicle and stuff using a keyboard tap the following keys:

  • Arrows Left/Right: Steering Left/Right
  • Arrows Up/Down: Throttle/Reverse
  • Space: Braking
  • Return/Enter: Reset
  • 1, 2: Camera
  • C: Toggle image capture
  • T: Train ANN
  • D: Toggle driver (Human/ANN)
  • Esc: Quit

virtualalvinn's People

Contributors

xissburg avatar

Watchers

erdenezul avatar James Cloos 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.