Rookie team seeking some programming advice

We’re a rookie team this year and we were hoping to seek some advice about the coding for FRC.

Here’s our situation:

We want to use Java to program our robot as it’s the most familiar to all of the programmers on the team. However, I just learned that it’s Java ME, which means some of the stuff we want to use (such as certain linear algebra libraries for AI) may not be compatible. I’ve taken a look at C/C++, but I’m not sure if it’s doable under Linux. I only saw mentions saying that Java can be developed under Netbean under Linux (Anyway to change that to eclipse by any chance?). Is Java the best choice here?

Since our programming team (which includes myself as the lead programmer) has little experiences on “bare metal”, how should we gain more experience? Is it beneficial to start something such as a mock interface and some code (maybe some algorithm such as object tracking instead actual control)?

Thanks for any input.

This is a really good reason, especially for a rookie team.

However, I just learned that it’s Java ME, which means some of the stuff we want to use (such as certain linear algebra libraries for AI) may not be compatible.

Many things are hard to find in FRC’s Java – you have to know where to look to find the network API, for instance. However, I found out (after build season was over) that it is there.

With respect to the linear algebra libraries, that is a concern. However, I don’t think it’s a large concern – the vast majority of teams don’t use non-FRC libraries of any sort.

I’ve taken a look at C/C++, but I’m not sure if it’s doable under Linux.

I recall there being a project to compile C++ for FRC on Linux, but it’s not done by FIRST, so I’d recommend against it (you’re at the mercy of whoever’s putting it together; if you choose to do it yourself, it’s just a lot of extra work).

I only saw mentions saying that Java can be developed under Netbean under Linux (Anyway to change that to eclipse by any chance?). Is Java the best choice here?

We did all of our programming under Linux – Java in NetBeans worked fine without the need for any tweaking. If Linux is all you have (or are willing to use), then it’s a fine choice.

The programming environment uses NetBeans plugins – I don’t think it’s possible to use Eclipse instead.

Since our programming team (which includes myself as the lead programmer) has little experiences on “bare metal”, how should we gain more experience? Is it beneficial to start something such as a mock interface and some code (maybe some algorithm such as object tracking instead actual control)?

Thanks for any input.

Other than learning the language (which you already know), there’s not much I can think of that would help you learn this system. You can look through last year’s WPILib documentation, code from other teams (C++ and Java’s versions of WPILib are virtually identical), and download the plugins for last year. The development environment set up for teams can hardly be described as “bare metal” (there’s a lot of libraries and virtually no low-level programming with this control system), so learning embedded programming is not necessary.

Good luck!

Ditto that.

@ shuhao: And if you were wanting to program “bare metal”, Java would seem not to be the best choice anyway, since it’s intended to be abstracted from the machine by the VM.

If you haven’t yet experienced the joys of programming something that reacts to the outside world in realtime through sensors and actuators, the paradigm shift associated with that kind of programming may be one of your hurdles. If you’re looking for a way to get a head start, that might be a fruitful area for study.

**

Most of the underlying math primitives (e.g. forward and inverse trig, exponents, square roots, etc.) are present in the FRC Java implementation - they went ahead and implemented more than the bare bones J2ME spec requires (albeit in a different package structure than J2SE…you need to do some digging to find where some of the classes live).

This does mean that adding J2SE JARs is generally not going to work. That said, I have found that this is seldom a big problem in FRC. Linear algebra and hardcore AI are not used by most teams, and those that do usually supply their own matrix math functions (for example). If you have the source for a library you would like to use, you may be able to get it to compile for FRC Java by changing the import statements for certain math/container functions and classes to point to the correct FRC Java packages. However, if your library uses a lot of J2SE-only classes, this approach would not work.

If you haven’t yet experienced the joys of programming something that reacts to the outside world in realtime through sensors and actuators

Unfortunately I have not, which is why I don’t know how practical it is to attempt to develop AIs, as I don’t know how long it will take to hammer out all the issues with basic control.

I have a good understanding of the theory for AIs that’s like these, but I have yet to find the the time to implement the theories behind them, especially on actual hardware, rather than simulated environments.

And since we are a rookie team, we have no prior experiences telling us how long it takes to write basic functions etc.

supply their own matrix math functions (for example)

Good idea. Gonna get the team to start porting/writing a basic linear algebra library. :smiley:

Edit:

Just noticed http://www.chiefdelphi.com/forums/showthread.php?t=87260

Since my primary language (also currently as lead programmer) is Python, and I have some numpy experience (as oppose to no experience in any Java Lin. Alg library, if they manage to get it ported, and I could try helping, too), is it worth a try to get Python onto cRIO and then go from there?

A text editor (geany) + ftp (nautilus) sounds like heaven to me (minus the initial wind river stuff, but not a big deal)

As a rookie team with no students or mentors who have done robot-control software, you are going to want all the seasoned help and support you can get with that type of software. The best-supported language for FRC is LabVIEW. C++ is 2nd, and Java 3rd. Python is a distant 4th.

**

Hm. Ok. I’ll keep a distant eye on it, then.

What about unittesting? Is that commonly done?

The stable experienced teams are more likely to have a disciplined software development methodology. Many (most?) of the rookie teams are happy just to get something working well enough to compete.

**

Hey guys. Although my team primarily uses Java, our mentor tested out some C++ code that he compiled and ran on his Ubuntu machine. I believe he used something called ucpp

I actually have no C++ experience, but I figured you guys should at least check this out.

Good luck!

Hi, we are having a Beta Test Seminar Right now at www.ustream.tv/channel/beta-test-conference (December 10, 10:00 AM-12:00 PM PST)