frc1675 / frc1675-2023

Team 1675 robot code for the 2023 FRC competition Charge Up
MIT License
2 stars 2 forks source link

Automatic Align Player Station #107

Open jagernet-ops opened 1 year ago

jagernet-ops commented 1 year ago

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.

jdlanning commented 1 year ago

@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 commented 1 year ago

@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!