-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable commands #131
base: dev
Are you sure you want to change the base?
Disable commands #131
Conversation
Qodana Community for JVM238 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
@@ -88,6 +89,11 @@ class Extender(private val io: ExtenderIO) : SubsystemBase() { | |||
.onTrue(setPosition { setpoint }) | |||
} | |||
|
|||
fun disableCommand(): Command = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to do this as a trigger. Then you won't need the until()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrist is missing?
fun Subsystem.setDisableCommand(command: Command) { | ||
val isDisabled = Trigger { DriverStation.isDisabled() }.whileTrue(command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
You should add an optional delay time for the drivetrain (which is missing a disable command). Note also WPILib has a built-in trigger for disable you should use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll debounce the trigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find the WPILib disable trigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/button/RobotModeTriggers.html
You can also find that in Galaxia5987/Recode2024#43 (which should also be implemented).
No description provided.