Series of programming/setup questions

I hope this is the correct group. I’m still feeling my way around here.

I have a few questions about JAVA directory structure and the process of compiling and distributing code once compiled. They’ll be separate posts but interrelated. If it seems I’ve missed something obvious in the docs, I’m sorry but there seems to be a lot to grasp for people new to the program.

This one is about update various software, coding, the directory structure of coding and the new command style of programming (OK not completely new but will be new to our group)

Through the spring 2023 competitions, our group has been using code from 3+ years ago as far as I’ve been able to determine. We are going to switch this year to the new way of programming but I’d like to make sure we do it properly and get all things done in the right order.

I know we have to update WPILIB. I bought a Win 10 machine to play with over the summer and have installed WPILib 2023.4.3 Release - March 29, 2023 on it to use with ROMI development. Is this the latest WPIlib? If not, where do I get it? If/when we update, will the installation overwrite the existing one or do we have to uninstall?

I’ll have to check the roboRIO version but I’m pretty sure we should upgrade. If we do upgrade to the latest, can we still use the old code as we start out?

For JAVA, does everyone use Oracle JAVA or are there others out there?

As I’ve been learning about programming for the robots (specifically ROMI) I’ve been creating each project to start at C:\whatever_I’m_learning. I know the directory structure for each project follows certain formats about where each part is located but wonder about having them separately at the C:\ level or putting them together under a common C:\robots directory.

Also is it possible to move a C:\robot1 project to a C:\robot_old directory and still be able to use it for development?

I notice that we import our local stuff as

import frc.robot.commands.ExampleCommand;

This is way down the directory chain from

C:\frc\romi_default\CreatingDefaultCommands\src\main\java\frc\robot\commands

What tells the compiler system to go to that part of the chain? Is this part of the WPILIB Create a new project magic? This may tie into my question about moving a project to a new directory

I realize this is a lot of questions but I thought I’d get them all out at once. Don’t feel like your have to answer every question to help. I’ll take them in bits and pieces.

Thanks for any help you can offer/

2 Likes

Excluding beta releases, 2023.4.3 is the most recent release, according to the WPILib repo.

I’m not certain but usually code-breaking changes happen between major versions each year. Updating code from, say, 2023.4.1 to 2023.4.3 is trivial, but from 2022.4.2 to 2023.4.3 would be more involved. Vendor library updates could also break some things.

Pretty much everyone uses Oracle Java but I’m pretty sure Amazon and Microsoft distribute their own JDKs as well.

I’m pretty sure 2023.4.3 is latest stable release from last season. It’s what I’ve installed and worked with on our new laptops the past couple of months. The install process of the WPILIB should install a new version into it’s own directory, but that only be based on the season like 2022 vs 2023.

Your roboRIO should be imaged with the appropriate version to match the WPILIB you are using, so if you are using 2023 WPILIB, your roboRIO should be imaged with one from that year too. If you open an old project into a new version of WPILIB in VSCoce, it will ask you if you want to update the project to the new version so you can run you old project code with the newer WPILIB.

We use the JAVE that comes with VSCode when you install WPILib.

WPILIB walks you through the process of creating a new Robot project and sets up the the necessary directories. You tell it the starting directory to place it in and it does the rest. After that you can move the project folder to a different directory, but you’ll have to use VSCode to open the folder in the new location afterwards.

Hopefully this answers some of your questions. If anything I said was confusing, let me know, I didn’t have my robot computer in front of me when answering the questions so I may have been off a few details.

Yup! Keep an eye out right around kickoff for install on the new versions.

While the answer is “sorta in some cases”, the simplest assumption is just to uninstall old and reinstall new. We actually go to the extreme of wiping and re-installing windows on our team laptops so there’s zero question of “which version of the tool are you using?” - we know exactly what we installed, no more, no less.

Yes - every year the rules manual dictates an updated and matching set of RIO image and driver station. Again, watch for this to be available at or shortly after kickoff.

Hopefully your code will be the same, but you’ll need to copy it into a new project (or update your old project) to the 2024 wpilib tools, re-flash the newest image on the RIO, and build/deploy your code.

In advance of the build season, you can check the list of what changed to help predict if you’ll be impacted.

Whatever wpilib installs :slight_smile:

A project is the folder which contains the top-level gradle files and .wpilib folder, and all the other subfolders.

I expect projects can be moved from one folder to another, as long as you don’t change the internal structure.

I expect your gradle files are in CreatingDefaultCommands. src/main/java is standard for all builds with how wpilib and gradle interact. frc/robot/java mirrors your import statement.

However, other than keeping the project itself intact, don’t get too hung up on each detail. A lot of this complexity has little to do with actually writing robot software, and is all a question of building the software for running on the robot, which is a massive rabbit hole of complexity. It might be interesting for a while, but the whole time you’re exploring it you’re not writing robot code… In any case… not to say don’t explore here, just be careful - I’ve been in this space for years and I still haven’t hit rock bottom on how builds in wpilib work.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.