-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix(api): LLD api math bugs #15860
Merged
Merged
fix(api): LLD api math bugs #15860
Conversation
This file contains 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
ryanthecoder
force-pushed
the
lld-api-math-bugs
branch
from
July 31, 2024 19:54
ec73fa8
to
5fe7d07
Compare
sfoster1
approved these changes
Jul 31, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but it feels like we can just add the tolerance in the same check? Also please fix up the caps in the title and fix up the description.
# probe_start_pos.z + z_distance of pass - pos.z should be < max_z_dist | ||
# due to rounding errors this can get caught in an infinite loop when the distance is almost equal | ||
# so we check to see if they're within 0.01 which is 1/5th the minimum movement distance from move_utils.py | ||
while (probe_start_pos.z - pos.z) < max_z_dist and not isclose( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
while (probe_start_pos.z - pos.z) < max_z_dist and not isclose( | |
while (probe_start_pos.z - pos.z) < (max_z_dist + 0.01): |
?
ryanthecoder
force-pushed
the
lld-api-math-bugs
branch
from
August 2, 2024 17:37
f63984c
to
c17f68d
Compare
ryanthecoder
added a commit
that referenced
this pull request
Aug 7, 2024
<!-- Thanks for taking the time to open a Pull Request (PR)! Please make sure you've read the "Opening Pull Requests" section of our Contributing Guide: https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests GitHub provides robust markdown to format your PR. Links, diagrams, pictures, and videos along with text formatting make it possible to create a rich and informative PR. For more information on GitHub markdown, see: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax To ensure your code is reviewed quickly and thoroughly, please fill out the sections below to the best of your ability! --> # Overview We had a few math buts in lld: we had a rounding error in the control loop that created an infinite loop. the two values should have been equal and therefor failed the < compare but due to python rounding we need to check with isclose, second we were calculating our max_d_distance from the safe_plunger_position instead of the pass_start_position <!-- Describe your PR at a high level. State acceptance criteria and how this PR fits into other work. Link issues, PRs, and other relevant resources. --> ## Test Plan and Hands on Testing <!-- Describe your testing of the PR. Emphasize testing not reflected in the code. Attach protocols, logs, screenshots and any other assets that support your testing. --> ## Changelog <!-- List changes introduced by this PR considering future developers and the end user. Give careful thought and clear documentation to breaking changes. --> ## Review requests <!-- - What do you need from reviewers to feel confident this PR is ready to merge? - Ask questions. --> ## Risk assessment <!-- - Indicate the level of attention this PR needs. - Provide context to guide reviewers. - Discuss trade-offs, coupling, and side effects. - Look for the possibility, even if you think it's small, that your change may affect some other part of the system. - For instance, changing return tip behavior may also change the behavior of labware calibration. - How do your unit tests and on hands on testing mitigate this PR's risks and the risk of future regressions? - Especially in high risk PRs, explain how you know your testing is enough. --> --------- Co-authored-by: caila-marashaj <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
We had a few math buts in lld:
we had a rounding error in the control loop that created an infinite loop. the two values should have been equal and therefor failed the < compare but due to python rounding we need to check with isclose,
second we were calculating our max_d_distance from the safe_plunger_position instead of the pass_start_position
Test Plan and Hands on Testing
Changelog
Review requests
Risk assessment