Software Training Session 3

Training material and helpful references for FIRST Robotics Competition (FRC) software development.

Part 1:

Currently we have been developing our code our own computers. For a real software project, it is best to have revision control scheme in place that allow for checking in your code into some repository.  In addition when working on a robot software project with multiple programmers, there should be a good way for each person to add new features and then release it to the team.  Git is a type of revision control system. Specifically we are using GitHub for revision control.

Next step is to open a new VS Code project and clone this repository:

https://github.com/djsandtoes/LCC_Robotics_Training.git
This will populate the repository on your computer.  After this, you will want to create a branch, and give it a unique name like myname_branch.  Run a build to confirm the code is clean.This code include support for PID and we will review and test it.

NOTE:  Rev Robotics provides example JAVA go for FRC which is was utilized here.  You can find this specific example at:

https://github.com/REVrobotics/REVLib-Examples/blob/main/Java/SPARK/Closed%20Loop%20Control/src/main/java/frc/robot/Robot.java

Note you will also see we have added a more subsystems, including:

Give it a try!

Next lets try to add a command that actually is composed of multiple commands.

Part 2:

This section will incorporate a Raspberry PI with a camera running PhotonVision which we will use to detect AprilTags and display to the Dashboard information when it see them.

<..>

Part 3:

This section will focus on using a baselined code base for our swerve drive based robot, along with one simple other subsystem and pathplanner-based autonomous routines.

First create a new project in VS Code by cloning this repository from github:

In addition, you will want to install (if not already installed), PathPlanner from here:

Note that currently there is a transition to the new 2025 version which as of today is still in Beta. The documentation is for the 2025 version, but the latest stable version to install is 2024.1.7:

What to review in this code base:

  1. DriveTrainSubsystem.java
  2. ServoSubsystem.java
  3. SwerveGamepadDriveCommand.java
  4. RobotContainer.java

What to try with this code base:

  1. Deploy code to robot and try to drive it with XBOX controller.
  2. Add support for raising and lowering the Flag via XBOX controller buttons.
  3. Test autonomous mode and the two available autos (MoveOut, MoveOutWithSpin)
  4. Change the existing autos and/or add a new one and retest the autos to confirm the robot responds as expected.