wiki:JavaWPI_Training

Version 8 (modified by fred, 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:

  • Instructions on how to set up a Java programming environment
  • Training resources for how to build basic Java programs
  • 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: Cover topics (at least) including: basic syntax, variables, strings, arrays, loops, conditionals, file IO, classes, inheritance, and overloading.

Learn how to build a simple robot project

Follow these tutorials to create a simple robot project in eclipse. The major distinguishing feature of the simple robot project is that tele-operated mode is just a single method, and gets called once at the start of the match. Autonomous is also its own method. The robot programs must have their own loop inside these methods to ensure that motors, pneumatics, and other components respond to user, sensor, and timing events.

You may need to refer to the previous instructions on installing eclipse to ensure you have the correct eclipse plugins installed. (The eclipse update site is http://first.wpi.edu/FRC/roborio/release/eclipse/):

Learn how to build a command-based robot project

Follow these tutorials to create a command-based robot project in eclipse. 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.