FRC Java Beginner - Help

Hello,

I am in charge of programming for my team along with a few others and we all know Java to a great extent. More specifically, we’ve been doing Java for 2-3 years so we know it to the intermediate extent, enough to program a robot of-course.

Last year (Grade 10 for me), we were using Labview and we were met with many setbacks and limitations that were absolutely annoying and we wish to transition our focuses to Java as it will be much more flexible to handle rather than the one-way Labview.

I, personally am planning to get started in learning the Java FRC API (WPI) during the summer so I can easily get a hand of things when the next competition hits.

Question(s):

  1. What is the best area to get started in learning the Java FRC API?
    Prefer: Videos & PDF

  2. Now for my second question - Is there some sort of a plugin or robot emulator in which I can test my FRC Java code with as you obviously can’t run the Java code and truly test if the robot is doing what you need it to do without the chassi, etc.

  3. Finally, I would love it if someone can give me an eBook / Video(s) explaining how the FRC Robot works like terminology and how it ties in with the programming so I will be able to program the robot understanding what everything means…

Thanks in advance.

  1. http://wpilib.screenstepslive.com/s/3120
  2. There have been attempts, but I still prefer to port the code and run it on Java SE (to debug and get better profiling data)
  3. Start here: http://www.team358.org/files/programming/

Slidell Robotics has a page about Java on our site: http://slidell-robotics.com/index.php?page=javaresources

On it you will find a few learning Java (which you seem to have a handle on) as well as a few for learning the FRC wpilibj such as Brad Miller’s video tutorial of the Command Based Robot Setup, and an online copy of the wpilibj JavaDoc.

At the bottom of the page are a couple of links to other teams resource pages as well.

Hope you do well and happy coding!

I was just about to post a similar question. Thanks.

This is our 3rd year and we have used Java in our first two years but we have lost our main programmer to graduation and coding mentorship has been spotty (at best). So we are really starting from scratch.

This is going to be a rebuilding year for our team in a lot of ways. I am pushing each of our subteams to come up with a list of measurable skills that the team should acquire prior to kickoff.

To that end… …beyond learn Java, the WPI Library, etc. I have made this list of tasks/skills that the coding team should work towards:

  1. Read Joysticks and buttons from Gamepad
  2. Output values to a motor
  3. Output values to multiple motors
  4. Read values from a switch
  5. Read values from a sensor (potentiometer, angular rate sensor)
  6. Read values from wheel encoders
  7. Display a value from the robot on the PC screen
  8. Display a value in the form of a visual gauge on the PC screen
  9. Understand how to use Debugging & Development Features of FIRST control system
  10. Use Joystick values to control a mulitmotor drive system with and without a shifter
  11. Implement various joystick scaling methods (e.g. “deadband removal”, “dynamic zeroing”)
  12. Implement various output scaling methods (e.g. “linearize Victor”)
  13. Implement a PID Feedback Loop on an arm or actuator
  14. Implement a PID feedback Loop on robot wheels
  15. Control a PID Feedback Loop via Joystick
  16. Control a PID Feedback Loop via buttons
  17. Use Angular Rate Sensor and Encoders to improve high speed “Drive Straight” Performance
  18. Use Angular Rate Sensor and Encoders to improve low speed “positioning” performance
  19. Basic Autonomous: sequence of steps in series
  20. Medium Autonomous sequence of steps some series, some parallel
  21. Medium High Autonomous including straight line robot motion back and forth with other steps
  22. Difficult Autonomous robot motion including turns
  23. Very Difficult Autonomous using camera to auto target using both arm and robot motion
  24. Use NetworkTables to implement Full Robot Monitoring System
  25. PC Based Vision System Based Targeting (height, distance, & angle wrt Robot)

What do folks think of this list? Would you add/remove anything? How about the ordering?

Do tell…

Joe J.

How i will a java programmer in high level?

Reported.

They just keep on coming.

I would recommend doing this independently from the other tasks, and I wouldn’t focus much on doing vision on the cRIO. The performance of a PC-based vision system is orders of magnitude better than one running on the cRIO, and the only major similarity between the libraries used on PC and cRIO is NetworkTables. It’ll probably be most worth your time to just work on a PC version.

Where could one start to try to get PC vision working? We would like to use javacv

I would suggest starting by digging through 341’s code and the related comments.

Between that and the openCV tutorials online, you should be able to make some decent progress.

A word of warning. The documentation for javaCV is terrible. Or I should say it was the last time I checked which was January/February of this year. The C++ variant seems to be their primary focus. Unfortunately the documentation isn’t always 1:1.

Figuring out how to get things up and running in the off season will be a huge advantage to you.

A more-current resource you might use is our team’s vision system for this year. It’s not well-commented (yet – I’m working on it), but it works on the same basic principles as Miss Daisy’s system while also showing how you can make parameters that can be tweaked at runtime through SmartDashboard’s properties window.

Being able to see your team’s robot this year really impressed me. Your vision system was amazing. Thanks for sharing!