-
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.
Merge branch 'main' into LEDsubSystem
- Loading branch information
Showing
16 changed files
with
437 additions
and
135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"java.server.launchMode": "Standard", | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"bin/": true, | ||
"**/.classpath": true, | ||
"**/.project": true, | ||
"**/.settings": true, | ||
"**/.factorypath": true, | ||
"**/*~": true | ||
}, | ||
"java.test.config": [ | ||
{ | ||
"name": "WPIlibUnitTests", | ||
"workingDirectory": "${workspaceFolder}/build/jni/release", | ||
"vmargs": [ | ||
"-Djava.library.path=${workspaceFolder}/build/jni/release" | ||
], | ||
"env": { | ||
"LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release", | ||
"DYLD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" | ||
} | ||
}, | ||
], | ||
"java.test.defaultConfig": "WPIlibUnitTests", | ||
// Style guide - most of this came from clicking buttons and then copying from my user settings.json | ||
// General editor stuff | ||
"editor.formatOnSave": true, // So you cant forget | ||
"editor.tabSize": 4, // 4 char width indentation | ||
"editor.detectIndentation": false, // Prevent above from being overridden | ||
"editor.insertSpaces": false, // use tab character instead of spaces | ||
"java.cleanup.actionsOnSave": [ | ||
"addOverride", | ||
] | ||
} | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"java.server.launchMode": "Standard", | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"bin/": true, | ||
"**/.classpath": true, | ||
"**/.project": true, | ||
"**/.settings": true, | ||
"**/.factorypath": true, | ||
"**/*~": true | ||
}, | ||
"java.test.config": [ | ||
{ | ||
"name": "WPIlibUnitTests", | ||
"workingDirectory": "${workspaceFolder}/build/jni/release", | ||
"vmargs": [ "-Djava.library.path=${workspaceFolder}/build/jni/release" ], | ||
"env": { | ||
"LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" , | ||
"DYLD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" | ||
} | ||
}, | ||
], | ||
"java.test.defaultConfig": "WPIlibUnitTests", | ||
"cSpell.words": [ | ||
"AHRS", | ||
"Deadzone", | ||
"Odometry", | ||
"setpoint", | ||
"velociticities" | ||
] | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package frc.robot.commands; | ||
|
||
import frc.robot.Constants.ArmConstants; | ||
import frc.robot.subsystems.Arm; | ||
import frc.robot.inputs.OptionButtonInput; | ||
import edu.wpi.first.wpilibj.TimedRobot; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
|
||
public class ArmRemoteControl extends Command { | ||
private final Arm arm; | ||
|
||
private final OptionButtonInput raiseArmButton; | ||
private final OptionButtonInput lowerArmButton; | ||
|
||
private final OptionButtonInput speakerPositionButton; | ||
private final OptionButtonInput ampPositionButton; | ||
private final OptionButtonInput intakePositionButton; | ||
|
||
|
||
public ArmRemoteControl(Arm arm, OptionButtonInput raiseArmButton, OptionButtonInput lowerArmButton, | ||
OptionButtonInput speakerPositionButton, OptionButtonInput ampPositionButton, OptionButtonInput intakePositionButton) { | ||
this.arm = arm; | ||
|
||
this.raiseArmButton = raiseArmButton; | ||
this.lowerArmButton = lowerArmButton; | ||
|
||
this.speakerPositionButton = speakerPositionButton; | ||
this.ampPositionButton = ampPositionButton; | ||
this.intakePositionButton = intakePositionButton; | ||
|
||
|
||
addRequirements(arm); | ||
} | ||
|
||
|
||
|
||
@Override | ||
public void initialize() { | ||
} | ||
|
||
/** | ||
* execute() is called repeatedly while a command is scheduled, about every | ||
* 20ms. | ||
*/ | ||
@Override | ||
public void execute() { | ||
|
||
// Arm Motor | ||
arm.changeArmAngleDegreesBy(Double.valueOf(raiseArmButton.getStateAsInt()) * TimedRobot.kDefaultPeriod * ArmConstants.DEGREES_PER_SECOND); | ||
arm.changeArmAngleDegreesBy(Double.valueOf(-lowerArmButton.getStateAsInt()) * TimedRobot.kDefaultPeriod * ArmConstants.DEGREES_PER_SECOND); | ||
|
||
// Arm Povs | ||
if (speakerPositionButton.getState()) { | ||
arm.setArmToSpeakerPosition(); | ||
} | ||
if (ampPositionButton.getState()) { | ||
arm.setArmToAmpPosition(); | ||
} | ||
if (intakePositionButton.getState()) { | ||
arm.setArmToIntakePosition(); | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
} | ||
} |
Oops, something went wrong.