Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getting-target-data.rst #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions source/docs/programming/photonlib/getting-target-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ Getting Data From A Target
* double ``getArea()``/``GetArea()``: The area (how much of the camera feed the bounding box takes up) as a percent (0-100).
* double ``getSkew()``/``GetSkew()``: The skew of the target in degrees (counter-clockwise positive).
* double[] ``getCorners()``/``GetCorners()``: The 4 corners of the minimum bounding box rectangle.
* Transform2d ``getCameraToTarget()``/``GetCameraToTarget()``: The camera to target transform. See `2d transform documentation here <https://docs.wpilib.org/en/latest/docs/software/advanced-controls/geometry/transformations.html#transform2d-and-twist2d>`_.

* Transform3d ``getBestCameraToTarget()``/``GetBestCameraToTarget()``: The camera to target transform.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any good docs pages we can link here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked and it does not seem so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're waiting for wpilib to add transform3d docs, let's expand on this a little bit more? Maybe "The 3d transform between your camera's origin and the target's origin. It's the same as transform3d, but generalized to 3d."?

Or poke around and find some ROS docs that explain 3d geometry? IDK.


.. tab-set-code::
.. code-block:: java
Expand All @@ -119,8 +118,8 @@ Getting Data From A Target
double pitch = target.getPitch();
double area = target.getArea();
double skew = target.getSkew();
Transform2d pose = target.getCameraToTarget();
List<TargetCorner> corners = target.getCorners();
Transform3d pose = target.getBestCameraToTarget();
List<TargetCorner> corners = target.getDetectedCorners();
mcm001 marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: c++

Expand All @@ -129,8 +128,8 @@ Getting Data From A Target
double pitch = target.GetPitch();
double area = target.GetArea();
double skew = target.GetSkew();
frc::Transform2d pose = target.GetCameraToTarget();
wpi::SmallVector<std::pair<double, double>, 4> corners = target.GetCorners();
frc::Transform3d pose = target.GetBestCameraToTarget();
wpi::SmallVector<std::pair<double, double>, 4> corners = target.GetDetectedCorners();

Getting AprilTag Data From A Target
-----------------------------------
Expand Down