Here’s Team 316’s code for our 2013 robot, Sure Shot SAM: https://github.com/LuNaTeCs-316/SureShotSAM
This was our first year using C++, having used LabVIEW in the past. Our program is based on the IterativeRobot template. It should be fairly well documented, although some sections like the autonomous definitely need work.
I’ve also been working on a couple of Java ports of our code, as that’s what we’re looking into using for next year. One uses the IterativeRobot and the other Command Based.
I’m curious, why did you port it to Java?
Also, what’s it like to port to Java - is there anything you didn’t anticipate to be a problem?
I ported it to Java because that’s what we are looking into using for next season. We’re making the switch because Java seems to have better support than C++, especially with the newer features like NetworkTables/Command Based Robot/SmartDashboard. Java as a language should be easier to teach to new students than C++. Also, the Java development environment is easier to setup IMO, and offers the advantage of being cross-platform.
Porting the code over to Java was pretty easy, since the Java and C++ versions of WPILib are very similar. It was just a matter of rewriting the same code with a different syntax. I haven’t had an opportunity to test it on a robot yet, so we’ll see if anything comes up in that process.