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

54 update vision files #59

Merged
merged 32 commits into from
Mar 5, 2025
Merged

54 update vision files #59

merged 32 commits into from
Mar 5, 2025

Conversation

SpectrumFRC3847
Copy link
Contributor

@SpectrumFRC3847 SpectrumFRC3847 commented Mar 3, 2025

Most of the branch here is due for testing on the robot and some things need to be adjusted in relation to vision alignment, PID tuning, and cleaning up the files: Vision.java, VisionStates.java, and for Swerve.java. In regard to visionsystem.java, most likely will be unused due to limelights already installed on the robot.

Goals:
VisionLogging in its own file to save space from the main Vision.java file
Calculation functions at the bottom subject to change
Using vision to send data to SwerveStates for values of the drivetrain to turn to
Significant testing needed

From,

@marcjuguilon

SpectrumFRC3847 and others added 19 commits February 16, 2025 16:22
First commit of this branch worked on for the vision branch
Rerolled addFilteredVisionInput to be used in periodic for vision; made chassisspeeds method in swerve public since addFilteredVisionInput neeeded it.

Other Miscellaneous changes in other files to support the changes in vision
Mostly documentation with some building of AlignToVisionTarget
Build a format for changes on the coming vision file:
with inspiration from 2024 code, 2025 vision commands will have similar functions but more related to reef alignment

Any changes to AlignToVisionTarget are discontinued and will be worked out and only used as a rudimentary guide to building configs and PIDcontrollers in vision.java

Future:
Maybe plans to include alignment to cage?
or alignment to source/human player coral station (hpcs)?

Co-Authored-By: marcjuguilon <[email protected]>
Seperated the four main configs for Vision:

Config (Command Config)- used to build each seperate command's PID command values and offsets

VisionStates Commands- commands used directly into vision states

Vision Commands- built to send commands between Vision commands, basically a transit between config methods and Vision Command
the method currently being built will replace the original PID command with a similar functionality

Co-Authored-By: marcjuguilon <[email protected]>
Started working on building the execute command used for alignToVision

Reorganized alignToVisionTarget

P.S. mostly finalized changes for the night

Co-Authored-By: marcjuguilon <[email protected]>
cleaning up this method/class since it doesn't seem worthwhile
Vision.java
renamed left limelight to front limelight

Building getDistanceToReeffromRobot()- this method is subject to change. the method essentially checks the tag id of the given tag that a limelight sees and checks it with its own list to validate the given tag(s) seen and returns an array of those distances.

Building cloesestReefFace- gets the cloesest reef face to the robot

angleBetweenRobotandReefFace- method that gets the theta value using pose estimation between robot pose and pose of the given tag id

Field.java- added the tag id's (based on blue field) to each reef faces given tag id

VisionSystem.java- built to test some cameras, probably  will discontinue these changes on this file but it still exists

Co-Authored-By: marcjuguilon <[email protected]>
getAdjustedReefPosition- returns the method for theta so that the next return to alignToReef

alignToReef- method that sends a swervecommand (WIP) witht he given theta value from getAdjustedReefPoisition
Should be finished for right now but Limelight isn't connecting for testing purposes

From Marc: WIll read new documentation
SwerveStates here can be reviewed before the pull request as a means of more fluidity between this branch and main.
@SpectrumFRC3847 SpectrumFRC3847 linked an issue Mar 3, 2025 that may be closed by this pull request
LimelightLogger -> VisionLogger
Now in its own file and added some logging into periodic

Pilot.java
removed a line to not mess with Pilot.java in main.
used for testing
@SpectrumFRC3847
Copy link
Contributor Author

SpectrumFRC3847 commented Mar 3, 2025

Not building currently, working on fixing the error @marcjuguilon

Edit: Fixed

a semicolon was missing...

Also commented out different fudges since they're most likely not to be used later but more like a reminder if needed to add.

Co-Authored-By: marcjuguilon <[email protected]>
SpectrumFRC3847 and others added 2 commits March 3, 2025 17:11
Currently testing the detection of RawFiducials on limelight

Progress:
the limelight can detect the tags but the periodic is experiencing an exception error, will need to solve soon

P.S. this framework is running out of battery

Co-Authored-By: marcjuguilon <[email protected]>
Vision will most likely work now, the only thing needed to adjust is the swerve position
@SpectrumFRC3847
Copy link
Contributor Author

SpectrumFRC3847 commented Mar 4, 2025

Working on issue currently, @marcjuguilon

Edit: Fixed

Conflicts should be resolved
Changes angle to reefs depending on the tag detected, there should never be enough distance from the vision to see the tags
@SpectrumFRC3847
Copy link
Contributor Author

SpectrumFRC3847 commented Mar 5, 2025

The swerve command still has to be teste, currently called VisionAim on pilot.java and SwerveStates.java. @marcjuguilon

@SpectrumFRC3847 SpectrumFRC3847 merged commit d8cc057 into main Mar 5, 2025
1 check passed
@SpectrumFRC3847 SpectrumFRC3847 deleted the 54-update-vision-files branch March 5, 2025 04:58
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.

Update Vision Files
4 participants