Skip to content

Commit

Permalink
in execute now
Browse files Browse the repository at this point in the history
  • Loading branch information
2491NoMythic committed Mar 28, 2024
1 parent a606284 commit 9ed5ec8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/main/java/frc/robot/commands/GroundIntake.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ public GroundIntake(IntakeSubsystem intake, IndexerSubsystem indexer, Drivetrain

// Called when the command is initially scheduled.
@Override
public void initialize() {
public void initialize() {}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
double robotSpeed = Math.sqrt(Math.pow(driveTrain.getChassisSpeeds().vxMetersPerSecond, 2) + Math.pow(driveTrain.getChassisSpeeds().vyMetersPerSecond, 2));
double rollerSpeed = (IntakeConstants.INTAKE_SPEED - (0.25 * IntakeConstants.INTAKE_SPEED)) * (robotSpeed / DriveConstants.MAX_VELOCITY_METERS_PER_SECOND) + (0.25 * IntakeConstants.INTAKE_SPEED);
double sideSpeed = (IntakeConstants.INTAKE_SIDE_SPEED - (0.25 * IntakeConstants.INTAKE_SIDE_SPEED)) * (robotSpeed / DriveConstants.MAX_VELOCITY_METERS_PER_SECOND) + (0.25 * IntakeConstants.INTAKE_SIDE_SPEED);
double indexerSpeed = (IndexerConstants.INDEXER_INTAKE_SPEED- (0.25 * IndexerConstants.INDEXER_INTAKE_SPEED)) * (robotSpeed / DriveConstants.MAX_VELOCITY_METERS_PER_SECOND) + (0.25 * IndexerConstants.INDEXER_INTAKE_SPEED);
double sideSpeed = (IntakeConstants.INTAKE_SIDE_SPEED - (0.25 * IntakeConstants.INTAKE_SIDE_SPEED)) * (robotSpeed / DriveConstants.MAX_VELOCITY_METERS_PER_SECOND) + (0.75 * IntakeConstants.INTAKE_SIDE_SPEED);
double indexerSpeed = (IndexerConstants.INDEXER_INTAKE_SPEED- (0.25 * IndexerConstants.INDEXER_INTAKE_SPEED)) * (robotSpeed / DriveConstants.MAX_VELOCITY_METERS_PER_SECOND) + (0.75 * IndexerConstants.INDEXER_INTAKE_SPEED);
intake.intakeYes(rollerSpeed, sideSpeed);
indexer.set(indexerSpeed);
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/settings/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public static final class ClimberConstants{
public static final class IndexerConstants{
public static final int INDEXER_MOTOR = 11;
public static final int CURRENT_LIMIT = 50;
public static final double INDEXER_INTAKE_SPEED = 0.3229 / 2;//ground intake
public static final double INDEXER_INTAKE_SPEED = 0.3229 ;//ground intake
public static final double HUMAN_PLAYER_INDEXER_SPEED = -0.5;//should be 0.5 TODO change to positive
public static final double INDEXER_SHOOTING_RPS = 90;
public static final double INDEXER_SHOOTING_POWER = 1;
Expand Down Expand Up @@ -358,8 +358,8 @@ public static final class IntakeConstants{
public static final int BRUSH_2_MOTOR = 2491;
public static final int BRUSH_3_MOTOR = 2491;
/** the desired speed for the intake when doing ground intake. In Percent-of-full-power, from -1 to 1 */
public static final double INTAKE_SPEED = 0.2086 / 2;
public static final double INTAKE_SIDE_SPEED = 0.1564 / 2;
public static final double INTAKE_SPEED = 0.2086 ;
public static final double INTAKE_SIDE_SPEED = 0.1564;
}
public static final class CTREConfigs {
public TalonFXConfiguration driveMotorConfig;
Expand Down

0 comments on commit 9ed5ec8

Please sign in to comment.