Currently, some functionality is performed outside the state machine meaning that logic to move the state machine through its states is actually outside the state machine. This will lead to software that cannot easily be maintained.
Suggestions:
'autonomousPeriodic()' should simply call executeRobotStateMachine() (or robotLoop()?)
Shooter spin-up should be part of the Shooting State machine
Reinstate storage-based automatic completion of shooting. If desired this could be enabled or disabled dependent on Tele-op vs. Autonomous, or better yet based on dashboard control. However, to be successful in autonomous, storage-based completion of shooting is required always.
Encapsulate the main functionality into functions rather than poking directly at the state variables. For example: startIntake(), startShooting(), etc.
For consistency with the other state machines, collapse the READY_TO_INTAKE state into the IDLE state.
Determine if INTAKE_WAITING is truly needed
Why is there a +1 here: if (mStorage.getBallCount() == mStorage.getCapacity() + 1). Is this working around a bug?
Consider moving the state machines into the respective subsystems
Currently, some functionality is performed outside the state machine meaning that logic to move the state machine through its states is actually outside the state machine. This will lead to software that cannot easily be maintained. Suggestions:
executeRobotStateMachine()
(orrobotLoop()
?)if (mStorage.getBallCount() == mStorage.getCapacity() + 1)
. Is this working around a bug?