frc4039 / 2024

Our 2024 competition robot repo
Other
1 stars 0 forks source link

Update Limelight Positions on compbot #57

Closed noahlinton closed 8 months ago

noahlinton commented 8 months ago

We have added a second limelight to the back of the robot. The cameras are angled out by 10 degrees.

We are still trying to tune their position, so the data is not very accurate. We may need to increase the yaw angle even more

@WyattDube @SteveJacka @Ben-Alderson What should we do next to improve this performance?

noahlinton commented 8 months ago

Updated tasks:

noahlinton commented 8 months ago

@Ben-Alderson did we apply the instructions here? Looking at 2023 code, it looks like this is different than last year. Specifically, looks like we need to give the limelight the field layout. This is based on our code calling MULTI_TAG_PNP_ON_COPROCESSOR in Vision.java

https://docs.photonvision.org/en/latest/docs/apriltag-pipelines/multitag.html#multitag-localization

Ben-Alderson commented 8 months ago

Yes looks like you need to give it a field layout. Perhaps that's why the custom JSON for the practice field didn't work very well. It's another thing we need to remember to reset for events.

noahlinton commented 8 months ago

Hmm okay. We will be playing with this on Wednesday at the field. Feels like a black box a little. Hoping we can sort it out.

noahlinton commented 8 months ago

Image

Ben-Alderson commented 8 months ago

The logic for scaling by distance is already integrated in Vision::getEstimationStdDevs.

The base standard deviation that function uses can be tweaked here in Constants.java. Larger numbers mean we "trust" the values less. So a bigger number will mean it takes longer for the robot to get to its true position, but it won't jump around as much.

noahlinton commented 8 months ago

@Ben-Alderson any advice on how to actually tune these values? I am reading through the classes to understand how they are implemented, and I see we have two cases, single target, and multi target. And I see that if the distance is greater than 4, we use "max values" (Min trust).

It looks like we could also maybe create a stdDev for use in auto?

Do we just guess and check these numbers? Do we look for the pose calming down?

Ben-Alderson commented 8 months ago

@noahlinton Yeah there's not really an objective method for optimizing these values. I would just mess around with it until it doesn't jump around much but still gets to the real position quickly enough.

Not sure why the stdDev would be different in auto?

noahlinton commented 8 months ago

Okay will do! Dont have a reason for being different in auto. Just thinking