-
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.
Merge branch 'development' of https://github.com/awtybots/FRC-2024 in…
…to development
- Loading branch information
Showing
13 changed files
with
91 additions
and
153 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
44 changes: 44 additions & 0 deletions
44
src/main/java/frc/robot/commands/ControlCommands/WristCommands.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,44 @@ | ||
// Copyright 2021-2024 FRC 6328 | ||
// http://github.com/Mechanical-Advantage | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// version 3 as published by the Free Software Foundation or | ||
// available in the root directory of this project. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
package frc.robot.commands.ControlCommands; | ||
|
||
import edu.wpi.first.math.MathUtil; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import edu.wpi.first.wpilibj2.command.Commands; | ||
import frc.robot.subsystems.wrist.Wrist; | ||
import java.util.function.DoubleSupplier; | ||
|
||
public class WristCommands { | ||
private static final double DEADBAND = 0.3; | ||
// idk what a realistic one is so this is roughly 90 degrees per 2 seconds | ||
private static final double MAXRADIANSPERSECOND = 1.6; | ||
|
||
private WristCommands() {} | ||
|
||
/** Wrist command using one axis of a joystick (controlling wrist velocity). */ | ||
public static Command joystickDrive(Wrist wrist, DoubleSupplier ySupplier) { | ||
return Commands.run( | ||
() -> { | ||
// Apply deadband (i.e. min DEADBAND max 1.0) | ||
double stickMagnitude = MathUtil.applyDeadband(ySupplier.getAsDouble(), DEADBAND); | ||
|
||
// Calcaulate new rotational velocity | ||
double rotationalVelocity = stickMagnitude * MAXRADIANSPERSECOND; | ||
|
||
// Send command to wrist subsystem to run wrist | ||
wrist.runTargetVelocity(rotationalVelocity); | ||
}, | ||
wrist); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
121 changes: 0 additions & 121 deletions
121
src/main/java/frc/robot/subsystems/wrist/ClawSubsystem.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.