First time with programming Java

Hello,

My team has basically started from the beginning and we are not sure how to program with Java. We were able to get everything downloaded and on the RoboRio. We are now trying to program our testbot that has 4 motor, 4 victor, tank drive, with one joystick.

The problem we have no one that really understands coding but we have a coach that can muddle himself through is he has video or tutorials to follow.

One really helpful resource is the Javadocs. Navigating it is pretty simple, you click on the class on the lower left and it displays information about the class. You’ll probably want to look at the Victor and RobotDrive classes for what you’re specifically using right now.

If you need specifically “How do I Java” rather than “How do I write robot code” I recommend Oracle’s tutorials. It takes quite a bit of effort to learn if it’s your first language, but it’ll be significantly easier if you have prior experience with text-based programming (eg. not scratch).

To be more specific:
Is there a place where we can find videos, example of drive code and so forth.

So, you want this page of the WPILib documentation? I don’t think there are any official videos or many official examples, but you can certainly search youtube or google.

Programming a robot is not a whole lot different than writing code for any other reason. Assuming you are sticking with the default project structure you will not need to get too in depth. There are some basic skills that everyone needs to understand for java, and by extension just about every other programming language.

First thing first: try to get default code running, nothing will frustrate you more than not knowing why your seemingly correct code isn’t working. Default code is a great way to eliminate variables in the pipeline.

Look for tutorials on:
Java IDEs (familiarize yourself with the tools of the IDE you are using)
Data types
Logic
Imports (and later external libraries (libs))
Methods (functions)
Loops (and timing)
Java WPI robotics Library (for java)

Once you have those skills look into Java specific tutorials (object based languages):
Objects (classes)
Inhertance
Interfaces

At this point you should know enough to explore on your own, you will have a better handle on what you need to learn.

The 2017 control system paper should provide information on compiling and uploading code to the RoboRio

Community, please feel free to add/disagree with my java skills basics list.

Good Luck,
Skye Leake

I highly recommend following tutorials from FIRST on how to get started with programming in Java:
https://wpilib.screenstepslive.com/s/4485/m/13809

I would start with the following:

  1. Setting up the Development Environment
  2. Creating and Running Robot Programs
  3. FRC Java Basics
  4. Using actuators (motors, servos, and relays)

The other advice is good but I get the feeling you guys won’t have the time to sit down and learn all the basics of Java. These guides should help you to get started and if you need help with anything, be sure to ask for help here detailing your problem. Feel free to message me directly as well if you would like.