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