Skip to content

Commit

Permalink
begin onboarding manual
Browse files Browse the repository at this point in the history
  • Loading branch information
JayK445 committed Nov 18, 2024
1 parent a1dd913 commit d45bb0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# FRC Onboarding
This training repository is the main focus of FRC Onboarding.
34 changes: 34 additions & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Goals
* Learn the structure of our codebase (beginning 2024 offseason)
* Learn how to organize and collaborate unstable code
* Learn how to use available tools to run and debug code

# General Code Structure
Notice all the different directories and files, only one is important for now
* 'src/' contains all source code
* 'src/main/java/frc/robot/' is where the "actual" robot code is located
* note the source files ('Robot.java', 'RobotContainer.java') and sub-directories ('subsystems/', 'subsystems/flywheels/')

# The beginning
'Main.java' is ostensibly the start of the program, but only contains a single line of code 'RobotBase.startRobot(Robot::new);'

1. 'Main.java' calls 'Robot.java', where the important start-up code is located
- 'Robot::new' calls the Robot class' constructor, but 'Robot.java' lacks one(?).
2. 'robotInit()' calls a lot of AdvantageKit logging functions. The 'RobotContainer' class contains the bulk of the robot set-up.
'''
@Override
public void robotInit() {
...
robotContainer = new RobotContainer();
}
'''
3. 'robotPeriodic' is called every 20ms (50Hz) and runs a single method. This is the [Command Scheduler](https://docs.wpilib.org/en/stable/docs/software/commandbased/command-scheduler.html), a class ultimately responsible for running all logic.
'''
@Override
public void robotPeriodic() {
CommandScheduler.getInstance().run();
}
'''

# What is 'RobotContainer.java'?
'RobotContainer' organizes all component code for the robot into a single class. Here

0 comments on commit d45bb0f

Please sign in to comment.