-
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
Drivetrain code #1
base: main
Are you sure you want to change the base?
Conversation
e0f5d86
to
faa3223
Compare
src/main/java/org/team1540/robot2025/subsystems/drive/DrivetrainConstants.java
Show resolved
Hide resolved
src/main/java/org/team1540/robot2025/subsystems/drive/GyroIOPigeon2.java
Show resolved
Hide resolved
src/main/java/org/team1540/robot2025/subsystems/drive/ModuleIOTalonFX.java
Show resolved
Hide resolved
src/main/java/org/team1540/robot2025/subsystems/drive/ModuleIOTalonFX.java
Show resolved
Hide resolved
src/main/java/org/team1540/robot2025/subsystems/drive/ModuleIOTalonFX.java
Show resolved
Hide resolved
synchronized (driveConfig) { | ||
driveConfig.MotorOutput.NeutralMode = enabled ? NeutralModeValue.Brake : NeutralModeValue.Coast; | ||
lastDriveConfigStatus = | ||
PhoenixUtil.tryUntilOk(5, () -> drive.getConfigurator().apply(driveConfig.MotorOutput, 0.25)); |
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.
So you can change the neutral mode of a spinning motor and it doesn't affect it? Please confirm this with docs or testing
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.
This has been tested, but it would definitely be beneficial to test this more. I did take this code from 6328 who used it all of last year without problems, however.
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.
Also neutral mode only an impact on motor behavior when it's outputting 0V, so changing neutral mode while spinning shouldn't affect anything.
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.
In theory sure but it depends on how their firmware deals with config applications. It could be blocking motor-side, in which case PID loops won't recalculate until it's done.
Initial drivetrain code.