Code Monkey home page Code Monkey logo

robot-emulator's Introduction

robot-emulator

This was my honours project for my undergrad degree. I took a 4th year robotics class. The robots you see were custom built by my professor. They were "propbots", and were programmed in a low-level, yet object-oriented language called "SPIN".

The one problem with the class is that lab time was limited. I loved the class so much I decided to do a robot emulator for my honours project. The goal was to have an editor that you could program with SPIN code, compile it, and then run the simulator to see what the robot would do. This would help eliminate the competition for lab time.

It was a titanic undertaking. I had to teach myself about parsers and compilers. I used ANTLR as the language recognition tool. I have found it works quite well. If memory serves, I wrote 12k lines of original code, and ANTLR generated another 13k.

It pretty much works. I have no doubt there are bugs, but I have a small collection of SPIN programs for which it compiles and runs and behaves how it is supposed to.

Edit:* Up until now I left the project as an Eclipse project, so you either had to fire it up in Eclipse, or navigate the bin folder to the correct class. I have included robot-emulator.zip, which is a folder with an executable jar file, as well as the necessary config and graphics files in order to make it runnable with simply a double-click. Sorry for not including this sooner.

The main class is dang.interpreter.IDE.java. This will bring up a primitive editor. The easiest thing to do is load up a program (file->load). I found that BlockGame.spin works the best. Some of the other programs I was using for testing, and I think I left some of them in an error state. Load BlockGame.spin, select "compile" from the menu, and push the "start tracker" button at the bottom.

From there press the "play" icon, and the robot will start looking for blocks. When it finds one it will grab it, bring it to a wall and release it. There are a bunch of other features you can experiment with. You can add in blocks and obstacles in real time.

Enjoy!

Darryl Hill

robot-emulator's People

Contributors

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