mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Reconfigure motor sensor between auto and teleop
This commit is contained in:
@@ -162,8 +162,7 @@ public class Drive extends SubsystemBase {
|
||||
m_rightFrontMotor.configSensorTerm(SensorTerm.Diff0, FeedbackDevice.IntegratedSensor, DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
|
||||
/* Configure Sum [Sum of both QuadEncoders] to be used for Primary PID Index */
|
||||
m_rightFrontMotor.configSelectedFeedbackSensor( FeedbackDevice.SensorDifference, DriveConstants.PID_PRIMARY,
|
||||
DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
configMotorSensor(FeedbackDevice.SensorDifference);
|
||||
|
||||
/* Don't scale the Feedback Sensor (use 1 for 1:1 ratio) */
|
||||
m_rightFrontMotor.configSelectedFeedbackCoefficient( 1, // Coefficient
|
||||
@@ -389,6 +388,15 @@ public class Drive extends SubsystemBase {
|
||||
runDriveStraightVelocityPID(moveVel, targetGyro);
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the feedback device for the motors.
|
||||
* @param feedbackDevice The feedback device to set it to, usually SensorDifference or
|
||||
*/
|
||||
public void configMotorSensor(FeedbackDevice type) {
|
||||
m_rightFrontMotor.configSelectedFeedbackSensor( type, DriveConstants.PID_PRIMARY,
|
||||
DriveConstants.DRIVE_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current yaw of the pigeon
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user