Skip to content
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

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Disable commands #131

wants to merge 6 commits into from

Conversation

Emma03L
Copy link
Contributor

@Emma03L Emma03L commented Jan 26, 2025

No description provided.

@Emma03L Emma03L requested review from katzuv and rakrakon January 26, 2025 15:12
@Emma03L Emma03L self-assigned this Jan 26, 2025
@Emma03L Emma03L added the enhancement New feature or request label Jan 26, 2025
@Emma03L Emma03L linked an issue Jan 26, 2025 that may be closed by this pull request
Copy link

github-actions bot commented Jan 26, 2025

Qodana Community for JVM

238 new problems were found

Inspection name Severity Problems
Unused symbol 🔶 Warning 133
Unnecessary modifier 🔶 Warning 22
Unnecessary conversion to 'String' 🔶 Warning 10
Field may be 'final' 🔶 Warning 6
Constant conditions 🔶 Warning 6
Unused receiver parameter 🔶 Warning 5
Unresolved reference in KDoc 🔶 Warning 3
Field can be local 🔶 Warning 2
Busy wait 🔶 Warning 1
Infinite loop statement 🔶 Warning 1
Declaration has problems in Javadoc references 🔶 Warning 1
Main function should return 'Unit' 🔶 Warning 1
'size() == 0' can be replaced with 'isEmpty()' 🔶 Warning 1
Call to 'printStackTrace()' 🔶 Warning 1
Class member can have 'private' visibility ◽️ Notice 24
Constant values ◽️ Notice 12
Lambda argument inside parentheses ◽️ Notice 4
Might be 'const' ◽️ Notice 3
Commented out code ◽️ Notice 1
Method can be extracted ◽️ Notice 1

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@@ -88,6 +89,11 @@ class Extender(private val io: ExtenderIO) : SubsystemBase() {
.onTrue(setPosition { setpoint })
}

fun disableCommand(): Command =
Copy link
Contributor

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()

Copy link
Member

@katzuv katzuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrist is missing?

Comment on lines 104 to 105
fun Subsystem.setDisableCommand(command: Command) {
val isDisabled = Trigger { DriverStation.isDisabled() }.whileTrue(command)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Galaxia5987 Galaxia5987 deleted a comment from katzuv Jan 27, 2025
@katzuv katzuv mentioned this pull request Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable commands
3 participants