Skip to content

Conversation

alaninnovates
Copy link
Contributor

Description

Detects if a camera mismatch is present in any camera and displays a banner in the dashboard for better visibility to the user.

image

Closes #1920

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with settings back to v2024.3.1
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@alaninnovates alaninnovates requested a review from a team as a code owner April 19, 2025 05:53
@samfreund
Copy link
Member

Looks good, I'll test when I have a chance.

@crschardt
Copy link
Contributor

This is all front-end code. Shouldn't we also involve the back-end, at least to log that there is a conflict?

@samfreund
Copy link
Member

Yea I agree with Craig. If we could just get a log message, ideally with the camera that should be there, and the camera that is there. This should only happen once, when the camera is initially connected and mismatched.

@samfreund
Copy link
Member

I'm no longer seeing a mismatch banner at all, even if there is a mismatch present.

@samfreund
Copy link
Member

Can we add some language about how matching is performed using USB port to the banner?

@alaninnovates alaninnovates requested a review from samfreund April 28, 2025 21:42
@samfreund
Copy link
Member

I'm no longer seeing a mismatch banner at all, even if there is a mismatch present.

This is still the case, not quite sure what changed but it's no longer working.

Copy link
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like new logic was added to VisionSourceManager. Let's make sure we also unit test this.

@samfreund samfreund added the enhancement New feature or request label May 7, 2025
@samfreund samfreund self-assigned this Oct 9, 2025
@samfreund samfreund marked this pull request as draft October 9, 2025 21:38
@github-actions github-actions bot added frontend Having to do with PhotonClient and its related items backend Things relating to photon-core and photon-server labels Oct 10, 2025
@samfreund samfreund marked this pull request as ready for review October 10, 2025 03:15
Comment on lines +454 to +455
// First, make sure that nickname is globally unique since we use the nickname
// in NetworkTables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated diff

Comment on lines +320 to +321
// FileVisionSources are a bit quirky. They aren't enumerated by the above, but
// i still want my
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto for everything here

protected final HashMap<String, CameraConfiguration> disabledCameraConfigs = new HashMap<>();

// Set of cameras that where a camera mismatch error was logged
protected final Set<String> warnedMismatchCameras = Set.of();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a Set really the best way to track this? Feels like we should be using a true object instead

* For file cameras, it checks the uniquePath and name.
* Note: When changing this function, change the equivalent function within photon-core's VisionSourceManager class
*/
export const camerasMatch = (camera1: PVCameraInfo, camera2: PVCameraInfo) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense for this logic to be dulicated now in the backend and frontend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Things relating to photon-core and photon-server enhancement New feature or request frontend Having to do with PhotonClient and its related items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make camera mismatch message more prominent

4 participants