Conversation
jkleiber
left a comment
There was a problem hiding this comment.
First pass. Also - is there any advantage to removing the vision/camera stuff? It seems like that doesn't really have anything to do with this change.
| rightJoystick.trigger() | ||
| .whileTrue( | ||
| drivetrain.applyRequest(() -> driveRobot.withVelocityX(-leftJoystick.getY() * MaxSpeedMetPerSec) | ||
| .withVelocityY(-leftJoystick.getX() * MaxSpeedMetPerSec) | ||
| .withRotationalRate(-rightJoystick.getX() * MaxAngularRateRadiansPerSec))); | ||
|
|
||
| masher.rightStickUp() | ||
| .onTrue(new InstantCommand(wrist::jogSetpointForward, wrist)); // jog wrist right | ||
| masher.rightStickDown() | ||
| .onTrue(new InstantCommand(wrist::jogSetpointBack, wrist)); // jog wrist left | ||
| leftJoystick.trigger() | ||
| .whileTrue(drivetrain | ||
| .applyRequest(() -> drive.withVelocityX(-leftJoystick.getY() * MaxSpeedMetPerSec * 0.5) | ||
| .withVelocityY(-leftJoystick.getX() * MaxSpeedMetPerSec * 0.5) | ||
| .withRotationalRate(-rightJoystick.getX() * MaxAngularRateRadiansPerSec * 0.5))); | ||
|
|
||
| // Intake | ||
| masher.leftTrigger() | ||
| .onTrue(new InstantCommand(intake::toggleIntake)); // toggle intake | ||
| rightJoystick.button(2) | ||
| .whileTrue(new InstantCommand(() -> drivetrain.seedFieldRelative())); | ||
|
|
||
| masher.rightTrigger() | ||
| .onTrue(new InstantCommand(intake::place)) // start place | ||
| .onFalse(new InstantCommand(intake::stop)); // stop place | ||
| controller.a().whileTrue(drivetrain.applyRequest(() -> brake)); | ||
| controller.b().whileTrue(drivetrain | ||
| .applyRequest( | ||
| () -> point | ||
| .withModuleDirection(new Rotation2d(-controller.getLeftY(), -controller.getLeftX())))); | ||
|
|
||
| masher.back() | ||
| .onTrue(new HomeWrist(wrist)); | ||
| controller.x().whileTrue(drivetrain.applyRequest(() -> drive.withIsOpenLoop(false))); |
There was a problem hiding this comment.
My preference would be to put this into a new drive command (or multiple commands if needed). Also we can make our own deadband utility function and put it in a separate class so that can be used by the command
There was a problem hiding this comment.
Could this be a separate PR?
| public Command applyRequest(Supplier<SwerveRequest> requestSupplier) { | ||
| return run(() -> this.setControl(requestSupplier.get())); | ||
| } |
There was a problem hiding this comment.
Would it be possible to put this.setControl(...) in periodic()? Then if we have multiple commands for controlling the drivetrain they can command a SwerveRequest that would get run periodically
There was a problem hiding this comment.
Could this be done in a separate PR?
|
once we get my relatively minor comments resolved, I think we should merge this branch ASAP. Since this and #34 are both upgrading the project to 2024, it looks like it's easier to get this one merged in and rebase the Arm refactor on top of it. |
|
Thanks for the feedback, my commits did not sync with the server because of the school's DNS. Once I get home, I'll make those changes and then we could merge tonight..? |
|
sounds like a plan 👍 |
|
All comments are fixed/resolved |
Summary
We are now using the Phoenix 6 beta, which has faster refresh capabilities (makes the drive smoother and more accurate). We also have to migrate the robot and drive to AdvantageKit and 2024 WPILib.
Project Scope
Implement new arm code