Giter Club home page Giter Club logo

robosim's People

Contributors

kirktopode avatar kwan3217 avatar

Watchers

 avatar  avatar

Forkers

kwan3217 stkwans

robosim's Issues

Consider refactoring code into smaller pieces

We are soon going to have three programs:

  1. RoboSim.exe, which does the simulator, and is the only one that exists now. We change its main() to do either simulated or NMEAPlayback.
  2. RoboPi.exe, which will drive real hardware and run the race
  3. Playback.exe, which will use logs recorded during a run to play back into a simulator, so we can see what the robot was thinking in a debugger.

Given this, we will need more classes, more implementations of the abstract classes that we have. I am starting up on the HardwarePiInterface now, which will be an interface from the hardware to the Pi (as the name suggests).

I'm not going to do it, but I suggest refactoring the code so that we have something like the following headers. The implementation (method code) for each class defined in someClasses.h would go into someClasses.cpp. We wouldn't have to stick to one class per header file/code file pair. Sometimes that will be convenient, but some classes naturally go together.

  • robot.h (Everything which is actually used in all 3 programs, so all the abstract classes, and waypoint)
    • Servo
    • Interface
    • Waypoint
  • Simulator.h
    • SimServo
    • Simulator
  • HardwarePi.h (I specifically reference the Pi because I have a daydream of squishing everything down to run on an Arduino, which would then have a HardwareArduino.h)
    • HardwarePiServo
    • HardwarePiInterface
  • Playback.h (No Servo, we would just use the one in Simulator.h)
    • PlaybackInterface (which would read logs generated by a roboBrain and recreate the sensor readings recorded therein)
  • roboBrain.h
    • roboBrain

I'm not doing this in a pull request, because this is such a big change that it would be hard to imagine any such pull request merging cleanly with another branch made at the same time. You might be working on HeaderSimRobo.h, but I just split that file into three pieces. Which one does your change go into? What we will have to do is merge all the branches, stop work on other features for a little while, do this refactoring, then pick up from there.

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.