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

Automatic Align Player Station #107

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

jagernet-ops
Copy link
Contributor

Issue: #88

This asked me to create a command which takes the robot's current position and cross references it with preset locations across the field to determine the robot's orientation. The encompassing code circles around a toggle-able command that will take in the robot's current position on the grid and cross reference with a Pose2d object in the Constants file. This Pose2d object contains the boundary x and y positions as well as it's complementary angle (180 for Red and 0 for Blue). The command is set to toggle upon the Driver hitting up on the DPad. There also are overrides in the command. These overrides call the getTargetID() method in the Vision subsystem to also lock the robot's position.

Copy link
Contributor

@jdlanning jdlanning left a comment

Choose a reason for hiding this comment

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

I will finish my review of the command tomorrow but just wanted to leave these comments now while im thinking about it

src/main/java/frc/robot/RobotContainer.java Outdated Show resolved Hide resolved
src/main/java/frc/robot/subsystems/Vision.java Outdated Show resolved Hide resolved
…so update the robot's position, and changed command conditional from toggleOnTrue to onTrue
Copy link
Contributor

@jdlanning jdlanning left a comment

Choose a reason for hiding this comment

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

@jagernet-ops Did you want us to try and test this out today if we get an opportunity?

@jdlanning
Copy link
Contributor

@jagernet-ops

@KaixWilliams and I tested this and made some fixes in the latest commit. We also had a key finding that our resetPose method was only working properly for 0 degree angles. So we had to adjust to using a different navx method to return the gyro angle.

Testing it a little bit more at a future meeting would make sense before merging this into main, but it’s very close!!

@jagernet-ops
Copy link
Contributor Author

@jagernet-ops

@KaixWilliams and I tested this and made some fixes in the latest commit. We also had a key finding that our resetPose method was only working properly for 0 degree angles. So we had to adjust to using a different navx method to return the gyro angle.

Testing it a little bit more at a future meeting would make sense before merging this into main, but it’s very close!!

Great to hear! I'm excited to hopefully finish up this by next Monday! Enjoy spring break!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

2 participants