Command Based Structure

Our team is fairly new and just recently we have decided to switch to a Command base structure. However, were are having trouble incorporating our Subsystems and Commands with our main class. Are all the methods of a subsystem in that class or should we create Command classes with these methods? If anyone can help us get an understanding of how tie all these classes together it would be greatly appreciated.

There’s a good guide to command based using last years robot:

There’s also a bunch of tutorial videos using the sample program (gears bot) provided with the WPILib samples:

The paradigm in general though
Subsystems characterize the physical components on the robot (drivetrain, shooter, bridge dropper…). The subsystems have the methods which make things move and read sensors. So for a shooter you may have a method which takes speed as a parameter.

Commands stitch the methods which are in the subsystems together to perform a complex action. So for example you may have a command to shoot a ball in the high goal. It might set the speed of your shooter to the right preset, set an angle on a hood, then drive a ball up into the shooter.

I suggest spending some time looking through a completed command based project (like the gearsbot sample which is included with the FRC plugins for Java). Learn by example.

If your team is more familiar with using the simplerobot or iterative robot projects, you might consider focusing on getting that to work since the season is rapidly approaching an end. Stepping too far into the deep end at this point could be dangerous.