Intro to FRC Programming - Romi
  • INTRODUCTION
    • Overview
    • Important Links
  • 💽Setup
    • Setting up the Romi's Software
    • Downloading Essential Tools
    • APCS vs FRC
  • How To Code in VSC
    • VSC- Intro
    • A Tour Through VSC
    • Creating a Regular Java Project
  • Intro to Java
    • What is Java?
    • Beginning Steps
    • 🟩Fundimentals of Java
      • Variables
      • Operations
      • Methods
      • Comments
      • If Statements and Conditions
      • Boolean Zen
      • Loops
      • Challenge- Create a Box House
    • 🟨Advanced Concepts
      • Objects
      • Scanners
      • Null Objects
      • Arrays
      • Errors
      • For-Each Loops
    • 🟥Object Oriented Programming
      • Basics of OOP
      • Instance Classes
      • Static Classes
  • 🕑Romi Curriculum- Timed Base
    • Romi Curriculum- Introduction
    • Creating a WPILIB Project
    • Running Your Code
    • The Robot Class
    • Subsystems
      • RomiDrivetrain
    • Cool stuff i will rename this category later
      • Spark Motors
      • PIDs
      • External Controllers
      • Encoders
  • 🖥️Romi Curriculum- Command Based
    • Command Based Code
    • RobotContainer
    • Commands
    • CommandScheduler
  • UNRELATED IMPORTANT CODING KNOWLEDGE
    • Constants
  • SAMPLE CODE
    • Tank Drive Example
      • RobotContainer
      • TankDriveSubsystem
      • MoveRobotCommand
    • Worktop Systems Sample Java Code
      • Belt Elevator Sample Code
      • Rotating Arm Sample Code
Powered by GitBook
On this page
  • Schedule()
  • Order of Scheduling
  1. Romi Curriculum- Command Based

CommandScheduler

Contrary to popular belief, the robot doesn't run on a combination of the dark arts and human sacrifices. It uses CommandScheduler! CommandScheduler is a singleton that runs commands that are scheduled. It's essentially the only thing (software wise) that makes the robot do stuff.

CommandScheduler works by updating every RobotPeriodic() loop back in theThe Robot Class class. Every time it updates, it checks all the commands and subsystems stored in the robot.

Schedule()

If you ever need to manually schedule a command you can simply call this on the command:

command.schedule()

Doing this automatically schedules the command without needing a trigger (Go to Commands for some context). However, it will have a different priority than trigger-bound commands, as shown below.

Order of Scheduling

CommandSchedule has a pretty orderly way of running stuff. The order is:

1) Periodic() from subsystems 2) Commands scheduled from Triggers 3) Commands added via schedule() 4) Subsystems' default commands

Every time CommandScheduler updates (about once every 20 milliseconds).

Normally whatever level a command is on doesn't really matter.

PreviousCommandsNextConstants

Last updated 2 months ago

🖥️