You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using the Advantagekit talonfx swerve example, we added cameras to or robot using photonvision.
Strangely, after turning the robot on the driver would sometimes lose control for 3-5 seconds, but only once per code initialization. When this happened the robot would either no respond to input if it wasn't moving, or it would keep driving and not respond to any input except the disable key.
The logs showed that the vision subsystem was the problem, taking 4+ seconds in the periodic method. I started debugging by commenting out sections of the code. The culprit was the function that handled getting the camera results so I commented out all the pose estimation code. That didn't fix it. I noticed that it happened then photonCamera.getAllUnreadResults() returned the max amount of results (20) So I tried clearing the array so that it would be empty, which didn't work. I evenually just decided to replace the photonCamera.getAllUnreadResults() with an empty list and that fixed it! I modiied the method to do nothing but call photonCamera.getAllUnreadResults() and the bug was back! It seems like something in that function is somehow taking 4+ seconds to execute :(
To Reproduce
Steps to reproduce the behavior:
Clone the advantage kit vision example.
Have 2 cameras plugged in and calibrated, set to 3d mode
Start the robot so it cant see any tags
Move the robot so it sees a tag for the first time
Observe a loop overrun where Vision.periodic() is 4+ seconds
Screenshots / Videos
If applicable, add screenshots to help explain your problem. Additionally, provide journalctl logs and settings zip export. If your issue is regarding the web dashboard, please provide screenshots and the output of the browser console.
Platform:
Hardware Platform: Ubuntu Server 24.04.2 Minimal
Network Configuration: Ethernet to radio aux1 port, Rio to radio rio port
Describe the bug
Using the Advantagekit talonfx swerve example, we added cameras to or robot using photonvision.
Strangely, after turning the robot on the driver would sometimes lose control for 3-5 seconds, but only once per code initialization. When this happened the robot would either no respond to input if it wasn't moving, or it would keep driving and not respond to any input except the disable key.
The logs showed that the vision subsystem was the problem, taking 4+ seconds in the periodic method. I started debugging by commenting out sections of the code. The culprit was the function that handled getting the camera results so I commented out all the pose estimation code. That didn't fix it. I noticed that it happened then
photonCamera.getAllUnreadResults()
returned the max amount of results (20) So I tried clearing the array so that it would be empty, which didn't work. I evenually just decided to replace thephotonCamera.getAllUnreadResults()
with an empty list and that fixed it! I modiied the method to do nothing but callphotonCamera.getAllUnreadResults()
and the bug was back! It seems like something in that function is somehow taking 4+ seconds to execute :(To Reproduce
Steps to reproduce the behavior:
Vision.periodic()
is 4+ secondsScreenshots / Videos
If applicable, add screenshots to help explain your problem. Additionally, provide journalctl logs and settings zip export. If your issue is regarding the web dashboard, please provide screenshots and the output of the browser console.
Platform:
Additional context
Only happens once per robot code init.
Running
PhotonCamera.setVersionCheckEnabled(false);
does not helpThe text was updated successfully, but these errors were encountered: