Photonvision performing .getBestCameraToTarget() acting weird

Hello,
I am running photonvision on a beelink coprocessor to detect the location of april tags relative to the robot and turn torwards the april tag. I noticed the robot wasn’t reacting to the april tags so I had the code print out the detected position and rotation of the tag, and I discovered that the tag’s position and rotation that was being returned was exactly the same as the robot’s position and rotation. I debugged further and discovered that the .getBestCameraToTarget() was returning Transform3d(Translation3d(X:0.0,0 Y:0.00, Z:0.00), Rotation3d(Quarternion(0.0, -10, 0.0, 0.0))) so it was not properly transforming the robots postion to get the tags position. My full code is here: https://github.com/Team3984v2/Codefor2023FRC3984/blob/main/testingPID2/src/main/java/frc/robot/commands/aimAtTarget.java
Does anyone know why my .getBestCameraToTarget() is doing this?
Thanks!

I think your GitHub repo is private

Ok, it should be fixed now.

Have you calibrated the camera and enabled 3D mode in photonvision?

Yeah, I just realized that it may have been calibrated wrongly. After I manage to find a way to access my coprocessor to change the calibration, I’ll try and see if it works. Thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.