generated from DeepBlueRobotics/EmptyProject2024
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a lot more buttons for 3 dif speaker, and climber
- Loading branch information
1 parent
1957d0c
commit 0686ec9
Showing
8 changed files
with
235 additions
and
11 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
47 changes: 47 additions & 0 deletions
47
src/main/java/org/carlmontrobotics/commands/armClimberDownPos.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,47 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package org.carlmontrobotics.commands; | ||
import org.carlmontrobotics.subsystems.Arm; | ||
import edu.wpi.first.math.trajectory.TrapezoidProfile; | ||
import edu.wpi.first.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class armClimberDownPos extends Command { | ||
/** Creates a new armPosAmp. */ | ||
private Arm arm; | ||
private Timer armProfileTimer = new Timer(); | ||
public armClimberDownPos(Arm arm) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
this.arm = arm; | ||
addRequirements(arm); | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
armProfileTimer.reset(); | ||
armProfileTimer.start(); | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
TrapezoidProfile.State setpoint = arm.calculateSetPoint(armProfileTimer.get(), arm.getCurrentArmState(), 6); | ||
arm.COMBINE_PID_FF_TRAPEZOID(setpoint); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) { | ||
armProfileTimer.stop(); | ||
armProfileTimer.reset(); | ||
} | ||
|
||
// Returns true when the command should end. | ||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/org/carlmontrobotics/commands/armClimberUpPos.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,47 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package org.carlmontrobotics.commands; | ||
import org.carlmontrobotics.subsystems.Arm; | ||
import edu.wpi.first.math.trajectory.TrapezoidProfile; | ||
import edu.wpi.first.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class armClimberUpPos extends Command { | ||
/** Creates a new armPosAmp. */ | ||
private Arm arm; | ||
private Timer armProfileTimer = new Timer(); | ||
public armClimberUpPos(Arm arm) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
this.arm = arm; | ||
addRequirements(arm); | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
armProfileTimer.reset(); | ||
armProfileTimer.start(); | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
TrapezoidProfile.State setpoint = arm.calculateSetPoint(armProfileTimer.get(), arm.getCurrentArmState(), 5); | ||
arm.COMBINE_PID_FF_TRAPEZOID(setpoint); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) { | ||
armProfileTimer.stop(); | ||
armProfileTimer.reset(); | ||
} | ||
|
||
// Returns true when the command should end. | ||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/carlmontrobotics/commands/armNextToSpeakerPos.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,48 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package org.carlmontrobotics.commands; | ||
import org.carlmontrobotics.subsystems.Arm; | ||
import edu.wpi.first.math.trajectory.TrapezoidProfile; | ||
import edu.wpi.first.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class armNextToSpeakerPos extends Command { | ||
/** Creates a new armPosAmp. */ | ||
private Arm arm; | ||
private Timer armProfileTimer = new Timer(); | ||
public armNextToSpeakerPos(Arm arm) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
this.arm = arm; | ||
addRequirements(arm); | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
armProfileTimer.reset(); | ||
armProfileTimer.start(); | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
TrapezoidProfile.State setpoint = arm.calculateSetPoint(armProfileTimer.get(), arm.getCurrentArmState(), 3); | ||
arm.COMBINE_PID_FF_TRAPEZOID(setpoint); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) { | ||
armProfileTimer.stop(); | ||
armProfileTimer.reset(); | ||
} | ||
|
||
// 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
48 changes: 48 additions & 0 deletions
48
src/main/java/org/carlmontrobotics/commands/armSafeZonePos.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,48 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package org.carlmontrobotics.commands; | ||
import org.carlmontrobotics.subsystems.Arm; | ||
import edu.wpi.first.math.trajectory.TrapezoidProfile; | ||
import edu.wpi.first.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class armSafeZonePos extends Command { | ||
/** Creates a new armPosAmp. */ | ||
private Arm arm; | ||
private Timer armProfileTimer = new Timer(); | ||
public armSafeZonePos(Arm arm) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
this.arm = arm; | ||
addRequirements(arm); | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
armProfileTimer.reset(); | ||
armProfileTimer.start(); | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
TrapezoidProfile.State setpoint = arm.calculateSetPoint(armProfileTimer.get(), arm.getCurrentArmState(), 4); | ||
arm.COMBINE_PID_FF_TRAPEZOID(setpoint); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) { | ||
armProfileTimer.stop(); | ||
armProfileTimer.reset(); | ||
} | ||
|
||
// 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