PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
264 stars 180 forks source link

Calibration has wrong list of resolutions #1225

Open KangarooKoala opened 6 months ago

KangarooKoala commented 6 months ago

Describe the bug When calibrating, the list of available resolutions is incorrect.

To Reproduce Steps to reproduce the behavior:

  1. Plug OV9281 into Orange Pi 5
  2. Go to the 'Dashboard' tab
  3. Record/Remember available resolutions
  4. Go to the 'Cameras' tab
  5. Note that available resolutions for new calibration are different

Screenshots / Videos Video showing both the actual resolutions (in the Dashboard tab) and the calibration resolutions (in the Cameras tab):

https://github.com/PhotonVision/photonvision/assets/91924258/4987f69f-b1ee-4430-a34c-7384cc9a86b4

(I had the lens cap on, so all black for the camera stream is expected)

Platform:

Additional context I also had to refresh to even get the calibration UI in the cameras tab, which may be from the same root issue.

mcm001 commented 6 months ago

I've seen this reported twice now. What do you see in the browser console? And any chance you could debug the bit of UsbCameraSource where we enumerate video modes?

I really wish my C920+lifecam setup at home would let me reproduce, but alas. And the ov9281 is totally gone from Amazon

crschardt commented 6 months ago

A couple questions:

  1. Do you have one or two cameras connected?
  2. How did you upgrade to 2024.2.4?
  3. Were the camera(s) already calibrated?
KangarooKoala commented 6 months ago

I've seen this reported twice now. What do you see in the browser console? And any chance you could debug the bit of UsbCameraSource where we enumerate video modes?

Unfortunately, I won't be able to check the browser console until the next meeting, but I'd be glad to help debug this issue! What would the debugging process look like? Sadly, I'm using a school laptop at meetings which has restricted permissions- I tried running ./gradlew photon-server:shadowJar --max-workers 2 -PArchOverride=linuxarm64 (based on the CI) earlier today, but I got an IOException for the photon-targetting:generateProto task since it couldn't run the protoc executable.

A couple questions:

  1. Do you have one or two cameras connected?
  2. How did you upgrade to 2024.2.4?
  3. Were the camera(s) already calibrated?
  1. One camera
  2. I flashed the orange pi with the linuxarm64-orangepi5 2024.2.3 image earlier, and then uploaded the linuxarm64 2024.2.4 jar and restarted the photonvision service (sudo systemctl restart photonvision.service).
  3. I had calibrated the camera earlier on different versions, though I don't remember which ones at the moment.
KangarooKoala commented 6 months ago

I did some more testing, and it seems to be based on the settings. Here's what I did:

  1. Flash with 2024.2.3 orange pi 5 image
  2. Update jar to 2024.2.4
  3. Export settings
  4. Calibration works fine
  5. Import these settings from previous versions (I don't remember exactly which versions I did stuff on)
  6. Calibration resolutions are broken
  7. Import settings from step 3 (photonvision-settings-export.zip)
  8. Calibration works fine