Conversation
| import java.util.Optional; | ||
|
|
||
| public class Camera { | ||
| private static final double AMBIGUITY_THRESHOLD = 0.2; |
There was a problem hiding this comment.
What does this constant do? Add comments
There was a problem hiding this comment.
Ambiguity refers to pose confidence. lower ambiguity means higher confidence in the robot's position, and vice versa. 0.2 is recommended
bjmcternan
left a comment
There was a problem hiding this comment.
Not too bad. Please add comments so we can better understand what this does.
| double totalDist = 0; | ||
| for (var target : pose.targetsUsed) { | ||
| totalDist += target.getBestCameraToTarget().getTranslation().getNorm(); | ||
| } | ||
|
|
||
| avgDist = totalDist / pose.targetsUsed.size(); |
There was a problem hiding this comment.
Correct me if I'm wrong, but if there's more than one target, wouldn't this be calculating the average distance to targets that are in different locations? If so, that seems like a useless value. Am I wrong in assuming "target"s are different april tags?
There was a problem hiding this comment.
The average distance is the average distance to the targets. The average distance is computed as a scalar multiplied to the current standard deviations. Photon vision already does the pose fusing for us, this is just adjusting the std devs based on distance to the target.
There was a problem hiding this comment.
Ah, I think I understand how this value is used now.
a8e92a1
Adds vision code for the robot
Closes #17