Don't interact with Libcamera cameras until connected#2447
Open
thatcomputerguy0101 wants to merge 1 commit intoPhotonVision:mainfrom
Open
Don't interact with Libcamera cameras until connected#2447thatcomputerguy0101 wants to merge 1 commit intoPhotonVision:mainfrom
thatcomputerguy0101 wants to merge 1 commit intoPhotonVision:mainfrom
Conversation
Contributor
Author
|
Tested, this resolves the crash when a libcamera CSI camera is not found. |
mcm001
reviewed
Apr 27, 2026
8102a9f to
b061737
Compare
…provider to only init on camera connection
1c9ba69 to
06d41db
Compare
| * Returns if the camera is currently connected. Use checkCameraConnected instead to properly | ||
| * handle camera connection. | ||
| */ | ||
| public abstract boolean isConnected(); |
Contributor
Author
There was a problem hiding this comment.
With how I restructured things isConnected probably should not be called by unrelated classes. The only place it is currently called is in VisionModule, for which I'm not sure which method yields better results.
Contributor
Author
|
I reconfirmed this still prevents the CSI camera crash, and the connection handler is run for a properly connected camera. Hot plugging is untested since CSI does not support it, and USB cameras take a different code path right now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Libcamera frame provider was trying to reset the video mode to the saved value regardless of whether the camera is currently attached or not. This waits until the camera is connected first to prevent crashing PhotonVision.
Meta
Merge checklist: