Skip to content

Commit

Permalink
Fix apriltag coordinate system notes (#348)
Browse files Browse the repository at this point in the history
* Fix apriltag coordinate system notes

* Fix apriltag coordinate system notes

---------

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
  • Loading branch information
mcm001 and mdurrani808 committed Mar 10, 2024
1 parent 0c9466f commit 8526d67
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions source/docs/apriltag-pipelines/coordinate-systems.rst
Expand Up @@ -11,24 +11,39 @@ You define the camera to robot transform in the robot coordinate frame.
Camera Coordinate Frame
-----------------------

The camera coordinate system is defined as follows, relative to the camera sensor itself, and when looking in the same direction as the sensor points:
OpenCV by default uses x-left/y-down/z-out for camera transforms. PhotonVision applies a base rotation to this transformation to make robot to tag transforms more in line with the WPILib coordinate system. The x, y, and z axes are also shown in red, green, and blue in the 3D mini-map and targeting overlay in the UI.

* The origin is the center.
* The x-axis points to the left
* The y-axis points up.
* The z-axis points out toward the subject.
* The origin is the focal point of the camera lens
* The x-axis points out of the camera
* The y-axis points to the left
* The z-axis points upwards


.. image:: images/camera-coord.png
:scale: 45 %
:align: center

|
.. image:: images/multiple-tags.png
:scale: 45 %
:align: center

|
AprilTag Coordinate Frame
-------------------------

The AprilTag coordinate system is defined as follows, relative to the center of the AprilTag itself, and when viewing the tag as a robot would:
The AprilTag coordinate system is defined as follows, relative to the center of the AprilTag itself, and when viewing the tag as a robot would. Again, PhotonVision changes this coordinate system to be more in line with WPILib. This means that a robot facing a tag head-on would see a robot-to-tag transform with a translation only in x, and a rotation of 180 degrees about z. The tag coordinate system is also shown with x/y/z in red/green/blue in the UI target overlay and mini-map.

* The origin is the center of the tag
* The x-axis is normal to the plane the tag is printed on, pointing outward from the visible side of the tag.
* The y-axis points to the right
* The z-axis points upwards

* The origin is the center.
* The x-axis points to your right
* The y-axis points upwards.
* The z-axis is normal to the plane the tag is printed on, pointing outward from the visible side of the tag.

.. image:: images/apriltag-coords.png
:scale: 45 %
:align: center
:scale: 50%
:alt: AprilTag Coordinate System

|
Binary file modified source/docs/apriltag-pipelines/images/apriltag-coords.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8526d67

Please sign in to comment.