Skip to content

Commit

Permalink
rename motor
Browse files Browse the repository at this point in the history
  • Loading branch information
zack0022 authored Mar 17, 2024
1 parent 3647105 commit 3b982b2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/java/frc/robot/subsystems/IndexerSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public IndexerSubsystem(BooleanSupplier isNoteIn) {
.withMotionMagicCruiseVelocity(IndexerConstants.INDEXER_CRUISE_VELOCITY)
.withMotionMagicAcceleration(IndexerConstants.INDEXER_ACCELERATION)
.withMotionMagicJerk(IndexerConstants.INDEXER_JERK));
indexerMotor.getConfigurator().apply(talonFXConfig);
m_IndexerMotor.getConfigurator().apply(talonFXConfig);

}
/**
Expand All @@ -67,38 +67,38 @@ public IndexerSubsystem(BooleanSupplier isNoteIn) {
* uses percentage of full power
*/
public void on() {
indexerMotor.set(IndexerConstants.INDEXER_INTAKE_SPEED);
m_IndexerMotor.set(IndexerConstants.INDEXER_INTAKE_SPEED);
}
/**
sets the indxer motor's percent-of-full-power to 0
*/
public void off() {
indexerMotor.set(0);
m_IndexerMotor.set(0);
}
/**
* sets the indexer motor to -INDEXER_INTAKE_SPEED (from constants)
* <p>
* uses percentage of full power
*/
public void reverse() {
indexerMotor.set(-IndexerConstants.INDEXER_INTAKE_SPEED);
m_IndexerMotor.set(-IndexerConstants.INDEXER_INTAKE_SPEED);
}
/**
* sets the percentage-of-full-power on the indexer
* @param speed the desired speed, from -1 to 1
*/
public void set(double speed) {
indexerMotor.set(speed);
m_IndexerMotor.set(speed);
}
/**
* uses the indexer motor's onboard Motion Magic control to move the indexer forward. To move backwards, use negative inches.
* @param inches the inches to move forward.
*/
public void forwardInches(double inches) {
double rotationsRequested = inches/IndexerConstants.MOTOR_ROTATIONS_TO_INCHES;
double position = indexerMotor.getPosition().getValueAsDouble()+rotationsRequested;
double position = m_IndexerMotor.getPosition().getValueAsDouble()+rotationsRequested;
MotionMagicVoltage distanceRequest = new MotionMagicVoltage(position);
indexerMotor.setControl(distanceRequest);
m_IndexerMotor.setControl(distanceRequest);
}

public void trackNote() {
Expand All @@ -118,7 +118,7 @@ public double getNotePosition() {
*/
public void magicRPS(double RPS) {
MotionMagicVelocityVoltage speedRequest = new MotionMagicVelocityVoltage(RPS);
indexerMotor.setControl(speedRequest);
m_IndexerMotor.setControl(speedRequest);
}

@Override
Expand Down

0 comments on commit 3b982b2

Please sign in to comment.