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 4 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 |
---|---|---|
|
@@ -11,3 +11,4 @@ PhotonLib: Robot Code Interface | |
driver-mode-pipeline-index | ||
controlling-led | ||
simulation | ||
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 |
53 changes: 53 additions & 0 deletions
53
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,53 @@ | ||
Getting Target Data | ||
=================== | ||
|
||
Getting The Latest Result | ||
mcm001 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
------------------------ | ||
|
||
Use ``PhotonCamera_GetLatestResult.vi`` to get the latest pipeline result. | ||
|
||
.. image:: images/get_latest_result.png | ||
|
||
|
||
Checking For Targets | ||
-------------------- | ||
|
||
Check if the pipeline has targets by using ``PhotonPipelineResult_HasTargets?.vi``. | ||
|
||
.. image:: images/has_targets.png | ||
|
||
``PhotonCamera_GetLatestResult.vi`` will also return if the pipeline has targets. | ||
|
||
.. image:: images/has_targets_2.png | ||
|
||
Getting an Array of Targets | ||
--------------------------- | ||
|
||
Each pipeline result will contain an array of targets to get that array use an unbunlde by name node and select targets. | ||
mdurrani808 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. image:: images/get_targets.png | ||
|
||
Getting The Best Target | ||
----------------------- | ||
|
||
``PhotonPipelineResult_GetBestTarget.vi`` will return the best target from a pipeline result. | ||
|
||
.. image:: images/get_best_target.png | ||
|
||
Getting Target By ID | ||
-------------------- | ||
|
||
If you are using an april tag pipeline you can use ``PhotonPipelineResult_GetBestTargetById.vi`` to return a target with a specified ID. | ||
mdurrani808 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. 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,14 @@ | ||
PhotonVisionLabVIEW (Unofficial) | ||
================================= | ||
|
||
What is PhotonVisionLabVIEW | ||
---------------------------- | ||
PhotonVisionLabVIEW is a LabVIEW Port of the PhotonVision library. | ||
mcm001 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. 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 JAS_Junk_FRC_TrajLib. Then click the REMOVE button. The uninstall should start. It should take 5 minutes or less. | ||
mdurrani808 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.