What is Command-based Programming?
In FRC robots, most of them tend to structure their code so that they are "Command-Based". Well, what is "Command Based"? Command Based code is using commands to transmit data across classes.
For our code, generally we treat the RobotContainer class (we will go over it later. Treat it as a client class) as a sort of hub for all of our data. Using Triggers- objects that let us detect stimuli such as pressing a button, we can send data through commands to Subsystems- files representing each of the mechanical systems of the robot, like a scoring mechanism or an elevator. Here is a crappy diagram if you want.
If you want an analogy to help understand this better, think of RobotContainer as an online store. When a customer buys a product online, think of it as like a Trigger. When a Trigger is ran, the store will send a delivery person to bring the product to the customer.
Last updated