Skip to content
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

Camera view updated to better respond to state #1437

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stephenjust
Copy link
Contributor

@stephenjust stephenjust commented Sep 28, 2024

In the previous camera view code, the frame didn't respond well to losses of connection, camera aspect ratio changes, etc.

Instead of changing the stream src, we can layer the camera view on top of the loading image, so that any time the camera signal is lost, even if it's because PhotonVision is restarting or you lose connection to the robot, the loading image is still in memory. This also fixes the responsiveness to connection loss.

This also only loads a stream if it is meant to be visible in the UI.

In the previous camera view code, the frame didn't respond well to
losses of connection, camera aspect ratio changes, etc.

Instead of changing the stream src, we can layer the camera view
on top of the loading image, so that any time the camera signal is lost,
even if it's because PhotonVision is restarting or you lose connection
to the robot, the loading image is still in memory. This also fixes the
responsiveness to connection loss.
@stephenjust stephenjust requested a review from a team as a code owner September 28, 2024 19:34
@mcm001
Copy link
Contributor

mcm001 commented Sep 28, 2024

Not blocking this PR: does this open the door to not trying to load both streams while looking only at one? Right now if you open devtools you can see both streams are being loaded even if only one is visible.

@stephenjust
Copy link
Contributor Author

Not blocking this PR: does this open the door to not trying to load both streams while looking only at one? Right now if you open devtools you can see both streams are being loaded even if only one is visible.

This PR as is doesn't solve that problem, but if it's something you want to solve, looks like a fairly simple change.

@stephenjust
Copy link
Contributor Author

Not blocking this PR: does this open the door to not trying to load both streams while looking only at one? Right now if you open devtools you can see both streams are being loaded even if only one is visible.

This PR as is doesn't solve that problem, but if it's something you want to solve, looks like a fairly simple change.

Latest commit fixes this.

@mcm001
Copy link
Contributor

mcm001 commented Sep 28, 2024

No way it was as simple as that, great stuff. I'm out this weekend but will try to draft someone else to try it out

@Alextopher
Copy link
Contributor

I can tonight ~5 hrs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants