frc868 / 2017-robot

The code for FRC 868's 2017 robot, Ratchet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Command Arguments & Command Factory

karagenit opened this issue · comments

Idea for simpler command structure:

  • Command Groups call only the main CommandFactory
  • CommandFactory has static methods such as getGearOpenCommand() or getGearClosedCommand()
  • CommandFactory calls subsystem-related command factories, such as GearCommandFactory
  • Subsystem factories such as GearCommandFactory take arguments such as a boolean for open/closed, build a command via creating a new object and calling the add... methods, and return the created object
  • More advanced factories for auton routines would exist, such as ones that take a starting point and build the auton routines accordingly

Possibly also an AutonFactory itself which adds multiple auton routines from different starting points: for example, builds a DropOffGearCG from RedOne, then a DumpHopperCG from GearPegOne, then a FeedAndShootCG from Hopper.

Instead of subsystem-related Factories, should the Commands simply take arguments in their constructors?