Skip to content
Johan Vandegriff edited this page Dec 15, 2016 · 1 revision

ControlLoop defines an interface for control loops such as a PID controller or a proportional controller. The computeCorrection function takes a target value, or setPoint, and an actual value, or input. It computes the power necessary for a motor or other output to bring the input closer to the setPoint.

The initialize() function is meant to reset the persistent (stored between loop cycles) variables. It should be called when the controller has been off for a while.

ftc/electronvolts/util/ControlLoop.java

package ftc.electronvolts.util;

/**
 * This file was made by the electronVolts, FTC team 7393
 *
 * An interface that allows for any type of control loop to be used
 * @see PIDController
 */
public interface ControlLoop {
    double computeCorrection(double setPoint, double input);
    void initialize();
}

Home | Features

This guide will walk you through the basics of creating state machines using the state-machine-framework.

  1. Importing Into Your Project
  2. The State Interface
  3. Simple State Machine
  4. Custom States
  5. Custom StateMachineBuilder
  6. Custom EndConditions

Clone this wiki locally