frc6377 / crescendo_2024

Other
5 stars 2 forks source link

Correct Limelight pose when running auton #99

Closed caseyjbrotherton closed 8 months ago

caseyjbrotherton commented 9 months ago

There are two issues that we have found with using limelight for pose estimation:

  1. When starting in front of the speaker, and moving directly away from the speaker, there is a static 4 inch error. This could be because something specific in the field. We should add an adjustment, and check on a regulation field when able to do so.
  2. When running a multiple note path is run, the limelight position caused the robot to hit the Amp. ( details below )

Notes on 2 based on testing done on January 28th:

Notes about tests on Jan 28th:

While running tests, there was network flakiness. Log messages were repeated on the rio log multiple times.

There was an excessive number of Pose logs. ( 2524 over 8 seconds; 1890 over 6 seconds ) Not sure if this has any impact, but noting it.

videos and logs:

https://drive.google.com/drive/folders/1Q-TxwRmtFgTbT9DsKBl7l5xFkL1TmkzR?usp=drive_link

caseyjbrotherton commented 9 months ago

@riversry Can you put the list of tests that we had discussed on Sunday here?

Only one I can remember is:

I would also like to test with isCompetition = true. This will reduce some of the shuffleboard network traffic. I would also like to test just placing the robot in front of the speaker, and check the poses again.

Last time we checked it was 4 inches off in X. I would like to see if that is still the same, and if there is any difference in Y

caseyjbrotherton commented 9 months ago

Here is another thought.

We update the robot pose using LimelightSubsystem every periodic when we find two tags. And we use the latency information as well to allow wpilib to make adjustments based specifically on the latency.

Limelight information is not updating every 20ms, so it appears from code that we are sending multiple of the same pose with an incorrect latency to update our position. ( If we wanted to verify that, we could log the pose every time we update it in the LimelightSubsystem periodic )

Can we figure out how to trigger the position update only when the NT:/limelight/hb tag increases? or the data changes?

Maybe use subscribe? https://docs.wpilib.org/en/stable/docs/software/networktables/publish-and-subscribe.html#subscribing-to-a-topic

riversry commented 9 months ago

Full list of ideas to try:

riversry commented 8 months ago

Tests:

Possible Issues:

riversry commented 8 months ago

Tests:

caseyjbrotherton commented 8 months ago

There have been a bunch of changes. We switched to photonvision. Photionvision is useable for positioning, especially closer to the speaker. It also updates 100ms instead of Limelight's 300ms.

Closing this issue. Follow on work for positioning will be under a new card