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

Rotate for limelight #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ProfessorAtomicManiac
Copy link
Contributor

@ProfessorAtomicManiac ProfessorAtomicManiac commented Mar 24, 2023

Added buttons to rotate the robot 35 degrees so that limelight odometry is more accurate (in more technical details: to avoid "tag flipping"). Drivers would need to press those buttons to face the robot at a curved angle at an apriltag for accurate odometry. Necessary for commands using DriveToPoint.

Comment on lines +95 to +97
axisTrigger(driverController, Driver.angleLeftButton).onTrue(new RotateToFieldRelativeAngle(Rotation2d.fromDegrees(MathUtil.inputModulus(drivetrain.getHeadingDeg() - turnFaceLimelightDeg, -180, 180)), drivetrain));
axisTrigger(driverController, Driver.angleRightButton).onTrue(new RotateToFieldRelativeAngle(Rotation2d.fromDegrees(MathUtil.inputModulus(drivetrain.getHeadingDeg() + turnFaceLimelightDeg, -180, 180)), drivetrain));

Copy link
Member

Choose a reason for hiding this comment

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

  1. These rotate relative to the current heading, but shouldn't they rotate to absolute field relative angles like the the d-pad buttons?
  2. Is the inputModulus call needed? Seems like that should already be happening either in the subsystem or in the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants