001package com.ctre.phoenix.motorcontrol.can; 002 003import com.ctre.phoenix.motorcontrol.FeedbackDevice; 004import com.ctre.phoenix.motorcontrol.can.BasePIDSetConfiguration; 005 006/** 007 * Configurables available to TalonSRX's PID 008 */ 009public class BaseTalonPIDSetConfiguration extends BasePIDSetConfiguration { 010 /** 011 * Feedback device for a particular PID loop. 012 * Note the FeedbackDevice enum holds all possible sensor types. Consult product documentation to confirm what is available. 013 * Alternatively the product specific enum can be used instead (see below). 014 * <p> 015 * <code> 016 * configs.primaryPID.selectedFeedbackSensor = TalonSRXFeedbackDevice.QuadEncoder.toFeedbackDevice(); 017 * configs.primaryPID.selectedFeedbackSensor = TalonFXFeedbackDevice.IntegratedSensor.toFeedbackDevice(); 018 * </code> 019 * </p> 020 */ 021 public FeedbackDevice selectedFeedbackSensor; 022 023 public BaseTalonPIDSetConfiguration(FeedbackDevice defaultFeedbackDevice) { 024 selectedFeedbackSensor = defaultFeedbackDevice; 025 } 026 027 /** 028 * @return string representation of configs 029 */ 030 public String toString() { 031 return toString(""); 032 } 033 034 /** 035 * @param prependString 036 * String to prepend to configs 037 * @return String representation of configs 038 */ 039 public String toString(String prependString) { 040 041 String retstr = prependString + ".selectedFeedbackSensor = " + selectedFeedbackSensor.toString() + ";\n"; 042 retstr += super.toString(prependString); 043 return retstr; 044 } 045 046} 047 048