wiki:JavaWPI_Training

Version 10 (modified by Timothy Lin, 9 years ago) (diff)

--

Java and WPI Training Resources

The following are resources to help students and mentors come up to speed with Java programming and WPI libraries. These are meant to be self-paced activities that will provide:

  1. Instructions on how to set up a Java programming environment
  2. Training resources for how to build basic Java programs
  3. Training on how to build robot programs in Java using the WPI libraries

Set up a java programming environment

First, ensure that you don't already have a viable programming environment available on your system. Check to see if eclipse is currently on your box. If it is, open it. If you can open eclipse, that means you should have a working Java installation as well. If you don't have either, follow the 2015 FRC documentation on screenstepslive to perform the necessary steps.

Learn some java

Follow these tutorials to build and run programs that successively demonstrate more features of the language and object-oriented programming (OOP) techniques. Tutorials point offers text-based learning and includes descriptions of everything you might want to do from learning hello-world to doing multiple inheritance and polymorphism. It compiles and runs programs on the command-line but this can easily be done in Eclipse. The youtube tutorials use eclipse by default. Several topics are duplicated between the following pages, so choose the source that works best for you:

Your goal is to cover at least these topics:

  • basic syntax
  • variables
  • strings
  • arrays
  • loops
  • conditionals
  • file IO
  • classes
  • inheritance
  • overloading.

Learn how to build a command-based robot project

Go to the main wiki page and look under the Java and WPI training section. Use these resources to learn about command-based programming. The major distinguishing feature of the command-based robot project is that subsystems and commands are their own java classes, and that commands are "scheduled" to be run in a continuous loop during the match. Commands perform a sequence of actions, and these actions may be taken on subsystems. Subsystems are code that control the actual hardware of the robot itself.