-
Notifications
You must be signed in to change notification settings - Fork 196
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
Fix Camera Index Assignment. #1031
Fix Camera Index Assignment. #1031
Conversation
appears that the remove method from arraylist was not functioning properly.
Can we add a unit test that fails with the old code and passes with the new code? |
This reverts commit 984b100.
Cleaner fix to the bug of multiple cameras of the same type aka dual arducam ov9281 uc844 not working. The past equals would result in false positives.
Reverted code back to original as the issue was truly with the equals case of the usb camera source class giving false positives. There is no easy/good way to update the unit test to mock a usb camera that much. |
Tested this build on Linux x64, works well with 3 identical Arducam cameras. |
Right, make two USBCameraSource with the same characteristics of the Arducams that are currently causing the issue and test the equality method. If it needs to be updated, it previously didn't work, a unit test should show that. |
One of the reasons the that usbcamerasource equals method used to incorrectly determine equality was because the quirkycamera object didn't have a basename. When a camera that had a quirk was found it would set equal to a predefined quirkycamera without changing the name first. Add unit test that will better test the equality of two usbcamerasources. This required a few changes to allow creating a fake usbcamerasource.
…ogs3539/photonvision into Index-Assignment-Fix
@viggy96 Just to confirm, with this PR you were able to use 3 identical cameras without renaming? Or you still needed to rename? |
I renamed each camera using the Arducam utility. |
Fixes a bug where multiple cameras would receive identical stream indexes and would cause at least one camera to not function at all and the other to not display a stream.