Here is as good a comprehensive guide to programming a robot as I am able to form with my 8 years of FRC knowledge. This is intended to take you from the very basics all the way to a highly competitive robot.
In many places, I will refer to outside sources. This way, I'm not re-inventing the wheel, and all the necessary information is compiled in one place. You won't miss anything for lack of searching. I'll also include the most important tips and tricks that are often missed in conjuction with what's available in whatever artice.
Let's start with that now
- WPILib Docs: Great documentation for all things robot code
- Phoenix Docs: Writing software for CTRE products (Motors, Pigeon IMU, CANCoders, etc.)
- REV Robotics Docs: Writing software for REV Products (PDH/PCM, Motors, Etc.)
- Limelight Docs: Using the Limelight camera
- Photonvision Docs: Using photonvision cameras
- PathPlanner Docs: Path planning for autos with PathPlanner
- Choreo Docs: A more optimized but harder-to-use alternative to PathPlanner
- EVERYTHING I'VE LEARNED ABOUT FRC (mostly)
- Our 2023 Software Demonstrates state space motion control with advanced kinematics and automation. Uses limelight apriltags for localizing. Tank drive. Overcomplicated and failed miserably, but structurally sound and worth looking at.
- Our 2024 Software Uses MotionMagicExpo for motion profiling, state space for the flywheels. Swerve drivetrain based on this project. Auto aiming with shoot-on-the-move calculations. Worked extremely well (considering it was written by one guy) but uses an unconventional State Machine architecture. This will make it confusing if you don't have a good understanding of programming in general.
- CTRE example projects Projects from CTRE that demonstrate how to use their stuff. Most of them are not command-based - keep in mind that they aren't examples of how to structure your code.
- FRC 254 2018 Very complicated, unconventional, ahead of it's time, and very confusingly structured. This project inspired me so I'm including it, but DON'T try and copy it.
- Our 2017 Code From a time before I did software; much, much simpler than any of the garbage I've done. Don't do a separate subsystem for the left and right half of a tank drive though, that's silly.
- Our 2022 Code The first robot I programmed that actually competed (ahem, COVID). Garbage code, I didn't know what I was doing. Worked good.
Before we get started, look through this google slide
It should give the requisite knowledge of robot hardware to get started. I'm sorry about how terrible it is, that's cause I made it.
- Setting up your driver station
- Setting up your robot project
- Basic programming skills & The Command Based Structure
- Using GIT & GitHub
- Getting a swerve running (using this project)
- End Effectors, Intakes, and Pneumatics
- Motion control 101
- How to program an elevator
- How to program an arm
- How to program a shooter
- Kinematics 101
- Creating good OIs & automation
- Creating an autonomous
- Telemetry & Useful Data Sources
- Programming Using State Machines
- Available debugging resources.
- Competitions and Sanity