FRC 8088 Bionic Panthers | 2024 Build Thread | Open Alliance

Programming Update - It’s Alive!!

Our [test] chassis finally moves!
After finishing up the wiring for the chassis, programming got the chance to test our code!
Here’s a video of it in action:

Our TEAM recently finished building our test chassis, as you can probably infer, but I just want to highlight how nice it is (and how much time it saves!) to have a chassis just for programming, as well as our “Robot-In-A-Box:”

PathPlanner & Code Changes

To share even more good news, our PathPlanner code works!

An explanation of our PathPlanner code can be found below:

Explanation

Firstly, here is an explanation of our path following code, which was explained in last week’s programming update:

Explanation v2

We did make some changes to this code, as well as our AutonChooser, which I’ll explain now.
We re-did our getChassisSpeed function to actually provide accurate, and real-time values:


This hasn’t been rigorously tested yet, but it has proven to work in a few short tests.

We also fixed our AutonChooser code, were we can run autos from Shuffleboard:
image
I’ll omit the rest of the code, as it is taken directly from PathPlanner’s getting started guide.

To summarize, we just had to call the right class/function and match names to the names of the autons in the PathPlanner UI.

Thanks to our test chassis and working PathPlanner code, we can finally record testing videos of Autonomous programs!
Here are a few:

Video of our robot running a circle path auto (for testing drift and such):

Video of our robot running a 4/5 note auto (drivetrain only):

Video of PathPlanner’s built in telemetry while running an auto:

While the programming TEAM was waiting for our mechanical TEAM, we had the chance to do some code organization and some monotonous tasks while we waited.

We decided to classify our robot commands into folders as shown below:
image

Our motivation to switch to folders was mainly to avoid this:


Our 23’ code

This was a little over half of our commands…

Along with this organization, we created “templates” for our subsystems.
We included imports, motor initialization & configuration, as well as some basic commands that we may need, shown below:
image

As you may see in the above image (MotorSpeeds.barRotatorSpeed), our TEAM decided to use our Constants.java file as much as possible this year. We have put the following into our constants file:

  • Device CAN IDs
  • Motor Speeds (not yet tuned)
  • Drive PID variables
  • Drivetrain Settings (chassis length, etc.)

We hope that using the Constants file will allow us to have one place for everything, no more mindless searching for one random number.

We also have our constants file sub-categorized into CAN IDs, Motor Speeds, Drivetrain settings, etc.

Issues

We didn’t encounter any major issues this past week, but here are some of the small ones that we came across:

Edit: We had some issues with our drive chassis, it seemed to be continuously resetting it’s heading, we are troubleshooting it currently.

  • Github desktop doesn’t copy empty folders (from the commands folders I mentioned earlier). Fixed by adding a simple text file to all of the folders.
  • Had a bit of trouble with CTRE’s Falcon 500 initalization, but found the right imports after a bit of trial and error.
  • Changed our AutonSelector from this:
    Screenshot 2024-01-25 091045
    To this:
    image
    And with that, running autons from Shuffleboard now work
  • Lastly, we had a bit of trouble connecting to our Limelight3, but it was resolved quickly. (To be more specific, we wired it wrong, and quickly fixed it.)

What’s next?

Here are our plans for next week:

  • Add command files for basic stuff (intake in/out/stop, etc.)
  • Continue to work on Limelight April Tag recognition
  • Test sequential/parallel commands with PathPlanner
  • Test PathPlanner with the robot not propped off the ground
  • Consider working on LED funtionality (still waiting on CANdle)
  • Troubleshoot chassis issues that arise

Ending Remarks/Statement(s)

Big thanks to @Greg_Needel for letting us know of the REV/CTRE conflict fix.
Another big thanks to @mjansen4857 for letting us know of an issue in our PathPlanner code.

Apologizes if the testing videos seem rushed / low quality / if my face was in the way too much…
Was in a bit of a rush to get them recorded

To clarify one thing, I commonly capitalize “TEAM,” that is because our lead mentor does the same, as they see “TEAM” as an acronym (Together everyone achieves more.)

Useful links from this week:
Our github
3d Visualization of April Tags with Limelight
Testing videos playlist
Moving while shooting CD thread

5 Likes