Skip to content

Controllers

Max Krieger edited this page Jun 20, 2016 · 20 revisions

Controllers translate human or autonomous input into organ actions. Human input can be taken from the ControlParser, while autonomous input can be taken from sensor Tissues/Organs. These inputs are then processed by Neurons.

All controllers contain a tick() boolean, which will perform methods on all relevant organs. Returning true means the controller no longer needs to be ticked, which is useful for autonomous-related opmodes where different actions are "phased" out.

Because of the disparity between teleop and autonomous-class controllers, they are separated into different folders.

In autonomous-related opmodes, you may want to use supercontrollers for situations requiring multiple controllers ticking at once (approach a beacon and read sensor values while waving a servo arm rapidly). The supercontroller is the one which is ultimately registered into the autonomous opmode, so once that supercontroller has finished its task, it will return true.

Most controllers correspond to different Organs. However, there can be multiple controllers for a given organ, for instance multiple macros to turn a specific number of degrees on the drivetrain organ.

If you have certain team-based contingencies, such as "move arm to the left if on blue, right if on red", these should absolutely be acknowledged in the respective controllers. The contingency itself could be an argument for the controller's constructor (Team.RED vs Team.BLUE).

Clone this wiki locally