photonvision icon indicating copy to clipboard operation
photonvision copied to clipboard

PhotonCamera Question

Open icemannie opened this issue 3 years ago • 7 comments

Have Gloworm 2021-01-11 lite running on a Limelight 2 to a Roborio. Was previously trying to set up Photonvision on a Romi with the same problem.

The photonvision network tables show up in Shuffleboard, and the driver mode and plpeline etries follow the camera web page settings. Problem I'm seeing is that camera.getPipeline() and camera.getDriverMode() don't follow the Network Table. (Only entries tested)

Copying the PhotonCamera code into a new class and changing

getDriverMode() from return driverMode to return driverModeEntry.getBoolean(false)

works.

icemannie avatar Dec 05 '21 19:12 icemannie

Thanks! That's odd for sure. It looks like we internally cache the last value the entries were set to -- maybe those are somehow getting out of sync?

mcm001 avatar Dec 05 '21 19:12 mcm001

The NetworkTableEntries for driverMode and pipelineIndex are read into booleans in the PhotonCamera(network table) constructor. So the booleans won't change when their respective entries change. The other methods all use the entries.

icemannie avatar Dec 06 '21 01:12 icemannie

Yeah, it looks like we assume that the PhotonCamera will be the only thing changing the pipeline/driver mode-iness of the camera. Which Isn't The Case.

mcm001 avatar Dec 06 '21 04:12 mcm001

The setDriverMode needs fixing also. The mode can just be set without reading the current state or use getDriverMode() instead of the boolean driverMode. The boolean can be removed. Same situation with pipeline index int.

icemannie avatar Dec 06 '21 11:12 icemannie

Found the same issue on setting the led mode. The PhotonCamera file as I am currently using is attached. PhotonCamera1.txt

team2194 avatar Dec 09 '21 19:12 team2194

If you'd like feel free to open a PR

mcm001 avatar Dec 09 '21 21:12 mcm001

Should have been addressed by #357

mcm001 avatar Dec 17 '21 15:12 mcm001

Are the inconsistencies still present on 2024-beta?

srimanachanta avatar Dec 01 '23 04:12 srimanachanta