Murray-Bridge-Bunyips / BunyipsFTC

FIRST Tech Challenge Robotics | Teams 15215, 22407, 24736
BSD 3-Clause Clear License
4 stars 0 forks source link

Command-based programming #62

Closed bubner closed 4 months ago

bubner commented 6 months ago

A popular paradigm for robotics is the use of command-based programming, which consists of a scheduler and subsystems working harmoniously to execute tasks.

We've partially implemented this in Autonomous with Tasks, but I want to make this system more mainline for both modes, perhaps by making components more integrated with a central "command processor" where actions and commands can be executed.

Subsystems at the moment don't have any interfaces or extensions of themselves apart from having OpMode dependency injection. This is fine and will remain the case but having an extension of this with a main scheduler would be a more sustainable idea, especially if we can seperate command from subsystem.

Subsystems like to interact with each other, so commands would seperate these out and remove some of the unknown functionality brought by methods exposed directly on the subsystem.

I'll look into this sort of style soon, along with upgrading the Task system to fit the purpose of the expansion as well. Autonomous OpModes will remain relatively the same then.

bubner commented 4 months ago

Command-based systems are working correctly, but these will need to be tested by migrating over an entire robot to this framework. However, this system seems to be ultimately complete.