Since the inner goal is behind the target, I’ve been trying to figure out how to accurately get the distance to it, especially when the robot is shooting from the side. The Limelight can estimate the distance to the center of the retroreflective target, and this works perfectly fine when the robot is centered with the target because you can just add an offset, but when shooting from the side, using this process becomes more and more inaccurate. Here is a diagram for more clarification:
I suppose the actual distance to the inner goal could be calculated using the Law of Cosines, but I don’t know how to find the angle phi or any other angles that are part of the triangle for that matter. The limelight documentation lists the network table entry ts (skew), but I am not sure if this corresponds to any of the angles in the triangle. Perhaps the better solution would be to simply use the SolvePnP 3D features and take the magnitude of the (x, z) vector wrt the inner goal point centered at the origin, but this does not solve the aiming problem. I am not sure of how to aim towards the inner goal and not towards the center of the target using the 3D features. Does aiming towards the inner goal have to do with any of the pitch, yaw, or roll components of the 3D pose reported by the PnP? If it does, will I have to compensate for the fact that the Limelight is mounted at an angle? I cannot use the tx value to aim because that will give the horizontal angle to the center of the target and not to the center of the inner goal. I could offset the tx angle by the angle theta, but I do not know how to find that either. There are probably many possible solutions to this problem, so I am curious to see how you all have solved it (if at all). Any help would be greatly appreciated. Thank you!