This repository was archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Add PhotonVisionLabVIEW docs #256
Open
brandonzx3
wants to merge
9
commits into
PhotonVision:master
Choose a base branch
from
brandonzx3:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f96951a
add labview doc
brandonzx3 37bf59c
add some text explaining these
brandonzx3 b3c7eab
update formatting and spelling
brandonzx3 d9d1b51
add images
brandonzx3 ca93355
made it more clear that this isnt maintained by photon team and credi…
brandonzx3 c94f3c6
made requested changes
brandonzx3 0d9d287
Rebase
brandonzx3 e9a768a
Merge branch 'PhotonVision:master' into master
brandonzx3 cc992e4
Merge branch 'master' into master
mcm001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ PhotonLib: Robot Code Interface | |
controlling-led | ||
simulation | ||
hardware-in-the-loop-sim | ||
labview/index |
23 changes: 23 additions & 0 deletions
23
source/docs/programming/photonlib/labview/camera-controls.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Driver Mode Pipeline Index And LED Mode | ||
======================================= | ||
|
||
Set Driver Mode | ||
--------------- | ||
|
||
Toggle driver mode using ``PhotonCamera_SetDriverMode.vi``. | ||
|
||
.. image:: images/set_driver_mode.png | ||
|
||
Set Pipeline Index | ||
--------------- | ||
|
||
The same can be done to change the pipeline index by using ``PhotonCamera_SetPipelineIndex.vi``. | ||
|
||
.. image:: images/set_pipeline_index.png | ||
|
||
Set LED Mode | ||
--------------- | ||
|
||
And the LED mode with ``PhotonCamera_SetLEDMode.vi``. | ||
|
||
.. image:: images/set_led_mode.png |
61 changes: 61 additions & 0 deletions
61
source/docs/programming/photonlib/labview/getting-target-data.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Getting Target Data | ||
=================== | ||
|
||
Getting The Latest Result | ||
mcm001 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
------------------------ | ||
|
||
What is a Photon Pipeline Result | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
A ``PhotonPipelineResult`` is a bundle that contains all information about currently detected targets from a camera. You can retrieve the latest pipeline result using ``PhotonCamera_GetLatestResult.vi`` | ||
|
||
.. image:: images/get_latest_result.png | ||
|
||
Checking for Existence of Targets | ||
-------------------- | ||
|
||
``PhotonCamera_GetLatestResult.vi`` will output a boolean named ``hasTargets?`` to inform the user as to whether the result contains any targets. | ||
|
||
.. image:: images/has_targets_2.png | ||
|
||
``PhotonPipelineResult_HasTargets?.vi`` can also be used to check for the existence of targets. | ||
|
||
.. image:: images/has_targets.png | ||
|
||
|
||
Getting an Array of Targets | ||
--------------------------- | ||
|
||
What is a Photon Tracked Target? | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
A tracked target contains information about a target from a pipeline result. This information includes yaw, pitch, area, and robot relative pose. | ||
|
||
Each pipeline result contains an array of targets. Use LabVIEW's ``Unbunlde by name`` node to get access to the array of targets. | ||
|
||
.. image:: images/get_targets.png | ||
|
||
Getting The Best Target | ||
----------------------- | ||
|
||
You can get the `best target <https://docs.photonvision.org/en/latest/docs/getting-started/pipeline-tuning/reflectiveAndShape/contour-filtering.html#contour-grouping-and-sorting>`_ using ``PhotonPipelineResult_GetBestTarget.vi`` | ||
|
||
.. image:: images/get_best_target.png | ||
|
||
Getting Target By ID | ||
-------------------- | ||
|
||
If you are using an AprilTag pipeline you can use ``PhotonPipelineResult_GetBestTargetById.vi`` will return a target with a specified ID. | ||
|
||
.. image:: images/get_target_by_id.png | ||
|
||
Getting Target Data | ||
------------------- | ||
* double ``PhotonTrackedTarget_GetYaw.vi``: The yaw of the target in degrees (positive right). | ||
* double ``PhotonTrackedTarget_GetPitch.vi``: The pitch of the target in degrees (positive up). | ||
* double ``PhotonTrackedTarget_GetArea.vi``: The area (how much of the camera feed the bounding box takes up) as a percent (0-100). | ||
* double ``PhotonTrackedTarget_GetSkew.vi``: The skew of the target in degrees (counter-clockwise positive). | ||
* double[] ``PhotonTrackedTarget_GetConors.vi``: The 4 corners of the minimum bounding box rectangle. | ||
* Transform2d ``PhotonTrackedTarget_GetBestCameraToTarget.vi``: 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>`_. | ||
|
||
.. image:: images/get_data.png |
Binary file added
BIN
+21.1 KB
source/docs/programming/photonlib/labview/images/distance_to_target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.1 KB
source/docs/programming/photonlib/labview/images/get_latest_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.5 KB
source/docs/programming/photonlib/labview/images/get_target_by_id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.84 KB
source/docs/programming/photonlib/labview/images/set_pipeline_index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
PhotonVisionLabVIEW (Unofficial) | ||
================================= | ||
|
||
What is PhotonVisionLabVIEW | ||
---------------------------- | ||
PhotonVisionLabVIEW is a third-party LabVIEW Port of the PhotonVision library made by `jsimpso81 <https://github.com/jsimpso81>`_. | ||
|
||
|
||
.. warning:: This project was not made and is not maintained by the PhotonVision team and may not receive updates as fast and some features may be missing. because of this the main development team will not be able provide support. Issues / questions should be reported at https://github.com/jsimpso81/PhotonVisionLabVIEW/issues or on ChiefDelphi. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
installing | ||
getting-target-data | ||
using-target-data | ||
camera-controls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Installing PhotonVisionLabVIEW | ||
================================ | ||
|
||
Installing | ||
---------- | ||
Download the latest install package. These can be found in the Releases section of the github repository. Here is a direct link. https://github.com/jsimpso81/PhotonVisionLabVIEW/releases/latest | ||
|
||
Select the .nipkg installation file for the version of LabVIEW being used, then double click it, or right click and select install. Administrative privledges will be needed to perform this installation. Follow the instructions. Usually selection of all the default answers is sufficient. Installation should take 5 minutes or less. | ||
|
||
Previous versions do not have to be uninstalled prior to installing a new version. The new version will automatically upgrade the older version. | ||
|
||
Removal | ||
------- | ||
To uninstall, open NI Package Manager. Select the Installed tab. Find and highlight PhotonVisionLib. Then click the REMOVE button. The uninstall should start. It should take 5 minutes or less. |
9 changes: 9 additions & 0 deletions
9
source/docs/programming/photonlib/labview/using-target-data.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Using Target Data | ||
================= | ||
|
||
Calculate Distance to Target | ||
------------------------------ | ||
|
||
If your camera is at a fixed height on your robot and the height of the target is fixed, you can calculate the distance to the target based on your camera’s pitch and the pitch to the target. | ||
|
||
.. image:: images/distance_to_target.png |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.