001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2008-2012. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj;
009
010/**
011 * This interface allows for PIDController to automatically read from this
012 * object
013 * @author dtjones
014 */
015public interface PIDSource {
016
017    /**
018     * A description for the type of output value to provide to a PIDController
019     */
020    public static class PIDSourceParameter {
021        public final int value;
022        static final int kDistance_val = 0;
023        static final int kRate_val = 1;
024        static final int kAngle_val = 2;
025        public static final PIDSourceParameter kDistance = new PIDSourceParameter(kDistance_val);
026        public static final PIDSourceParameter kRate = new PIDSourceParameter(kRate_val);
027        public static final PIDSourceParameter kAngle = new PIDSourceParameter(kAngle_val);
028
029        private PIDSourceParameter(int value) {
030            this.value = value;
031        }
032    }
033
034    /**
035     * Get the result to use in PIDController
036     * @return the result to use in PIDController
037     */
038    public double pidGet();
039}