-
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.
- Loading branch information
1 parent
0180cb6
commit 55266d2
Showing
16 changed files
with
329 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */ | ||
/* Open Source Software - may be modified and shared by FRC teams. The code */ | ||
/* must be accompanied by the FIRST BSD license file in the root directory of */ | ||
/* the project. */ | ||
/*----------------------------------------------------------------------------*/ | ||
|
||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import edu.wpi.first.wpilibj2.command.CommandBase; | ||
import frc.robot.RobotContainer; | ||
import frc.robot.subsystems.IntakeSub; | ||
|
||
public class AutoIntakeIntake extends CommandBase { | ||
|
||
public AutoIntakeIntake() { | ||
addRequirements(RobotContainer.intakeSub); | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
System.out.println("Intake intake Command init"); | ||
SmartDashboard.putBoolean("Exist", true); | ||
SmartDashboard.putBoolean("Not Exist", false); | ||
SmartDashboard.putBoolean("Exist Execute", false); | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
SmartDashboard.putBoolean("Exist Execute", true); | ||
System.out.println("Intake intake Command exe"); | ||
RobotContainer.intakeSub.intakeOut(); | ||
RobotContainer.intakeSub.runIntake(IntakeSub.intakeSpeed); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) { | ||
RobotContainer.intakeSub.runIntake(0); | ||
SmartDashboard.putBoolean("Not Exist", true); | ||
} | ||
|
||
// Returns true when the command should end. | ||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
src/main/java/frc/robot/commands/auto/AutoDistanceDriveCommand.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,45 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */ | ||
/* Open Source Software - may be modified and shared by FRC teams. The code */ | ||
/* must be accompanied by the FIRST BSD license file in the root directory of */ | ||
/* the project. */ | ||
/*----------------------------------------------------------------------------*/ | ||
|
||
package frc.robot.commands.auto; | ||
|
||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import edu.wpi.first.wpilibj2.command.CommandBase; | ||
import frc.robot.RobotContainer; | ||
|
||
public class AutoDistanceDriveCommand extends CommandBase { | ||
private double distance; | ||
|
||
public AutoDistanceDriveCommand() { | ||
addRequirements(RobotContainer.driveSub); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
SmartDashboard.putNumber("this is the encoder of r1", RobotContainer.r1.getEncoder().getPosition()); | ||
RobotContainer.driveSub.drive(0.5, 0); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) { | ||
} | ||
|
||
// Returns true when the command should end. | ||
@Override | ||
public boolean isFinished() { | ||
if(RobotContainer.r1.getEncoder().getPosition() > 35){ | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
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,38 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */ | ||
/* Open Source Software - may be modified and shared by FRC teams. The code */ | ||
/* must be accompanied by the FIRST BSD license file in the root directory of */ | ||
/* the project. */ | ||
/*----------------------------------------------------------------------------*/ | ||
|
||
package frc.robot.commands.auto; | ||
|
||
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; | ||
import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup; | ||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
import frc.robot.commands.AutoIntakeIntake; | ||
import frc.robot.commands.AutoShootIntake; | ||
import frc.robot.commands.auto.paths.Move; | ||
|
||
// NOTE: Consider using this command inline, rather than writing a subclass. For more | ||
// information, see: | ||
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html | ||
public class AutoIntaking extends SequentialCommandGroup { | ||
/** | ||
* Creates a new AutoIntaking. | ||
*/ | ||
public AutoIntaking() { | ||
|
||
addCommands( | ||
// new AutoDistanceDriveCommand(), | ||
new BasicAuto(), | ||
// new Move(1, false).withTimeout(Move.commandTime), | ||
new ParallelCommandGroup( | ||
new AutoIntakeIntake(), | ||
new Move(1, false).withTimeout(Move.commandTime) | ||
) | ||
); | ||
// Add your commands in the super() call, e.g. | ||
// super(new FooCommand(), new BarCommand()); | ||
} | ||
} |
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
Oops, something went wrong.