Skip to content

Commit

Permalink
more pose tests that seem to work
Browse files Browse the repository at this point in the history
  • Loading branch information
spellingcat committed Nov 17, 2023
1 parent f7caaf3 commit 38c2d8c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ private void configureBindings() {
.a()
.whileTrue(
swerveSubsystem.poseLockDriveCommand(() -> 3, () -> 1, () -> Math.PI, true, false));
controller
.b()
.whileTrue(
swerveSubsystem.poseLockDriveCommand(() -> 4, () -> 0.5, () -> 0, true, false));
operator
.y()
.whileTrue(
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/frc/robot/subsystems/Swerve/SwerveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,25 @@ public CommandBase poseLockDriveCommand(
() -> deadband(yController.calculate(pose.getY(), y.getAsDouble()), 0),
() ->
deadband(
thetaController.calculate(pose.getRotation().getRadians(), theta.getAsDouble()), 0),
thetaController.calculate(pose.getRotation().getRadians(), theta.getAsDouble()),
0),
fieldRelative,
isOpenLoop,
false)
.alongWith(
new PrintCommand(pose.getX() + " x"),
new PrintCommand(pose.getY() + " y"),
new PrintCommand(thetaController.getPositionError() + " heading error"))
.alongWith(
new RunCommand(
() -> {
Logger.getInstance()
.recordOutput("pose lock x error", xController.getPositionError());
Logger.getInstance()
.recordOutput("pose lock y error", yController.getPositionError());
Logger.getInstance()
.recordOutput("pose lock heading error", thetaController.getPositionError());
}))
.alongWith(
new RunCommand(
() ->
Expand Down

0 comments on commit 38c2d8c

Please sign in to comment.