Skip to content

Conversation

@KangarooKoala
Copy link
Contributor

@KangarooKoala KangarooKoala commented Jun 14, 2024

Ignore the commit message- After testing on Monday 6/10, it was working. Not sure what changed, though, which might be worth investigating.

Main purpose is to have a mode where it rotates towards an AprilTag for use at outreach. The control is done in Shuffleboard to avoid accidental activations. Not terribly well tuned, but it should still be a decently interesting demo.

double robotToTagAngleTimestamp =
s.apriltagsProcessor.getLastRotatedAngleTimestamp();
var robotAngle = s.drivebaseSubsystem.getPose().getRotation();
var robotToTagAngle = s.apriltagsProcessor.getLastRotatedAngle();

Choose a reason for hiding this comment

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

You might move this after the if() {} below. No reason to have the computer do the work to get robotToTagAngle if you will never use it when the if is true.

}
// Camera is rotated so that global left is camera down
lastRotatedAngle = Rotation2d.fromDegrees(-target.getPitch());
lastRotatedAngleTimestamp = pipelineResult.getTimestampSeconds();

Choose a reason for hiding this comment

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

Add a break; here. Once you've found the one you want, there is no reason to continue through the rest of the loop.

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.

4 participants