Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

basic python docs #332

Merged
merged 2 commits into from
Feb 2, 2024
Merged

basic python docs #332

merged 2 commits into from
Feb 2, 2024

Conversation

gerth2
Copy link
Contributor

@gerth2 gerth2 commented Feb 2, 2024

So basic it's wearing ugg boots while ordering a vanilla latte.

@gerth2 gerth2 requested a review from mdurrani808 February 2, 2024 20:20
mdurrani808
mdurrani808 previously approved these changes Feb 2, 2024
Copy link
Contributor

@mdurrani808 mdurrani808 left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -17,6 +19,19 @@ Paste the following URL into the box that pops up:

.. note:: It is recommended to Build Robot Code at least once when connected to the Internet before heading to an area where Internet connectivity is limited (for example, a competition). This ensures that the relevant files are downloaded to your filesystem.

Offline Install
---------------
Offline Install - Java/C++
Copy link
Contributor

Choose a reason for hiding this comment

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

Work in progress for 4 years and counting 😄

// Check if the latest result has any targets.
hasTargets = result.hasTargets()

.. warning:: In Java/C++, You must *always* check if the result has a target via ``hasTargets()``/``HasTargets()`` before getting targets or else you may get a null pointer exception. Further, you must use the same result in every subsequent call in that loop.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why we never just ended up making this an optional value. Not relevant to the review.

Relevant to the review: does this not need to be checked in python?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well python just returns an empty array. so user still has to deal with it but the behavior is better than null pointer.

I'm not sure Optional was in a ton of use in FRC at the time the API shape was formed.... but probably worthwhile for a summer thing

@gerth2 gerth2 merged commit 341271b into PhotonVision:master Feb 2, 2024
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants