PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
263 stars 181 forks source link

[photonlib-py] Fix pose estimator bug that prevents on-coprocessor MultiTag from running #1185

Closed EWall25 closed 8 months ago

EWall25 commented 8 months ago

This is a small fix for the PhotonPoseEstimator added in #1178, reviewed by. @mcm001 reviewed it an hour or two ago.

Before, on-coprocessor multi-tag would only run if the PhotonPipelineResult's targets list was populated. This list won't always have targets, even if there is a valid multi-tag result. So, multi-tag wouldn't run. The bug might also be present in the Java version of PhotonLib, but I haven't tested that.

Now, there is an exception in the update() method to allow multi-tag to run without a full targets list.

mcm001 commented 8 months ago

The targets list will always be present, but the per tag pose may not be set. I don't think this does quite what you think it does

EWall25 commented 8 months ago

Okay, I understand now. Thanks!