Open
Conversation
After modifying offset, it moves turret to the updated position using the offset.
codeNinja-1
requested changes
Mar 20, 2026
| operator | ||
| .axisLessThan(Axis.kRightX.value, -0.5) | ||
| .and(() -> fineControl) | ||
| .onTrue(this.robot.getTurret().modifyOffsetAngle(Degrees.of(3))); |
Collaborator
There was a problem hiding this comment.
We want these offsets to be roughly proportional to the joystick position, now just ±3 if the magnitudes of the joystick values are greater than 0.5.
Contributor
Author
There was a problem hiding this comment.
I changed the line temporarily to:
.onTrue(this.robot.getTurret().modifyOffsetAngle(Degrees.of(operator.getRawMagnitude(Axis.kRight.value)*-2)));
I don't know the code for finding the position of the joystick
| * @return a Command that, while scheduled, continuously moves the turret toward the supplied | ||
| * target angle while attempting to maintain the supplied target velocity | ||
| */ | ||
| public Command track( |
Collaborator
There was a problem hiding this comment.
Add the offset to track().
| @@ -1,9 +1,19 @@ | |||
| { | |||
Collaborator
There was a problem hiding this comment.
Undo changes to this file. It's a configuration that we just want to leave the same.
| .axisLessThan(Axis.kRightX.value, -0.5) | ||
| .and(() -> fineControl) | ||
| .onTrue(this.robot.getTurret().modifyOffsetAngle(Degrees.of(3))); | ||
|
|
Collaborator
There was a problem hiding this comment.
We also need to be able to offset the hood.
Still some major issues, but it's an improvement
we had to change the return type of setOffsetAngle to void instead of Command so that it constantly updates the input parameter newOffset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added manual offset and refresh to adjust position for accuracy. It is a manual turret correction