April Tags set angle

Hello, I am trying to implement April Tags with a Raspberry Pi 4, USB camera, and photon vision. My goal is to use the angle and range from the April tag in order to calculate what angle my arm subsystem should be set to. I would greatly appreciate it if anyone could help me with this task or provide examples.

If you’re storing a CameraToRobot Transform2d, you can use the .getTargetToCamera() method as described in the photonvision docs, and then transform the given output by the CameraToRobot. That will give you the the TargetToRobot pose, which you can then use with some basic trig to calculate your arm angle.

If OP isn’t using that data for anything else then they would actually enter the camera to shooter transform instead of the camera to robot transform. Otherwise, OP needs to add another step - robot to shooter transform.

I am not trying to move the robot drive base itself, only the arm subsystem with april tags.

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