-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adjust ID's and shooter config * Improve controls * Add hood adjuster motor * Fix CME and add debug to test if working * Uncomment intake code * uncomment intake code (part 2) * idk
- Loading branch information
Showing
10 changed files
with
149 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
package frc.robot.robotcomponents; | ||
|
||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
import frc.robot.auton.AutonIntake; | ||
|
||
public class Intake { | ||
|
||
public static void autoIntake() { | ||
Robot.getTeleopActionRunner().removeActionsOfType(AutonIntake.class); | ||
Robot.getTeleopActionRunner().addActionToRun(new AutonIntake()); | ||
} | ||
|
||
public static void startFloorIntake() { | ||
// Robot.motors.getIntake().set(Constants.INTAKE_SPEED); | ||
Robot.motors.getIntake().set(Constants.INTAKE_SPEED); | ||
} | ||
|
||
/* This will spin the motor backwards in an attempt to eject a stuck note*/ | ||
public static void backtrack() { | ||
// Robot.motors.getIntake().set(Constants.MOTOR_BACKTRACK_SPEED_PERCENT); | ||
Robot.motors.getIntake().set(Constants.MOTOR_BACKTRACK_SPEED_PERCENT); | ||
} | ||
|
||
public static void stopFloorIntake() { | ||
// Robot.motors.getIntake().stopMotor(); | ||
Robot.getTeleopActionRunner().removeActionsOfType(AutonIntake.class); | ||
Robot.motors.getIntake().stopMotor(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/frc/robot/auton/AutonMoveHoodToPosition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package frc.robot.auton; | ||
|
||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
|
||
public class AutonMoveHoodToPosition extends AutonAction { | ||
|
||
public HoodPosition targetPosition; | ||
|
||
public AutonMoveHoodToPosition(HoodPosition targetPosition) { | ||
this.targetPosition = targetPosition; | ||
} | ||
|
||
@Override | ||
public boolean isDone() { | ||
return true; | ||
// double error = Math.abs( | ||
// Robot.motors.getHoodAdjuster().getEncoderPosition() - targetPosition.getTargetRotations() | ||
// ); | ||
// return error < Constants.SHOOTER_HOOD_ADJUSTMENT_ERROR_ROTATIONS; | ||
} | ||
|
||
@Override | ||
public void initiate() { | ||
// int multiplier = 1; | ||
// if (Robot.motors.getHoodAdjuster().getEncoderPosition() > targetPosition.getTargetRotations()) { | ||
// multiplier = -1; | ||
// } else { | ||
// multiplier = 1; | ||
// } | ||
// Robot.motors.getHoodAdjuster().set(Constants.SHOOTER_HOOD_ADJUSTMENT_SPEED * multiplier); | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
// Robot.motors.getHoodAdjuster().stopMotor(); | ||
} | ||
|
||
public enum HoodPosition { | ||
INTAKING(Constants.HOOD_INTAKE_POSITION_ROTATIONS), | ||
SHOOTING_DEFAULT(Constants.HOOD_SHOOTING_POSITION_ROTATIONS); | ||
|
||
private double encoderRotations; | ||
|
||
private HoodPosition(double encoderRotation) { | ||
this.encoderRotations = encoderRotation; | ||
} | ||
|
||
public double getTargetRotations() { | ||
return encoderRotations; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters