Conversation
for more information, see https://pre-commit.ci
davidvng
requested changes
Dec 19, 2025
Contributor
davidvng
left a comment
There was a problem hiding this comment.
Thanks for the updates! Just some small changes, including a typo that should fix the failing check.
| return True, f"Axis {axis} forward limit: {human_state} (raw={state})" | ||
|
|
||
| @ocs_agent.param('axis', type=str) | ||
| def get_reverse_limitswitch(self, sesion, params): |
Contributor
There was a problem hiding this comment.
Suggested change
| def get_reverse_limitswitch(self, sesion, params): | |
| def get_reverse_limitswitch(self, session, params): |
| return None, "unknown" | ||
|
|
||
| # --- Interpret raw | ||
| human_state = "not triggered" if state == 1 else "triggered" if state == 0 else f"unknown ({state})" |
Contributor
There was a problem hiding this comment.
Suggested change
| human_state = "not triggered" if state == 1 else "triggered" if state == 0 else f"unknown ({state})" | |
| human_state = "not triggered" if state == 1 else ("triggered" if state == 0 else f"unknown ({state})") |
| return None, "unknown" | ||
|
|
||
| # --- Interpret raw | ||
| human_state = "not triggered" if state == 1 else "triggered" if state == 0 else f"unknown ({state})" |
Contributor
There was a problem hiding this comment.
Suggested change
| human_state = "not triggered" if state == 1 else "triggered" if state == 0 else f"unknown ({state})" | |
| human_state = "not triggered" if state == 1 else ("triggered" if state == 0 else f"unknown ({state})") |
BrianJKoopman
requested changes
Jan 5, 2026
Member
BrianJKoopman
left a comment
There was a problem hiding this comment.
A couple more small comments from me.
Comment on lines
+1107
to
+1112
| session.data = { | ||
| 'axis': axis, | ||
| 'raw_state': state, | ||
| 'human_state': human_state, | ||
| 'timestamp': time.time(), | ||
| } |
Member
There was a problem hiding this comment.
Document this structure in the docstring. (See ocs docs.)
Comment on lines
+1135
to
+1140
| session.data = { | ||
| 'axis': axis, | ||
| 'raw_state': state, | ||
| 'human_state': human_state, | ||
| 'timestamp': time.time(), | ||
| } |
Member
There was a problem hiding this comment.
Same as above, this needs to be documented in the docstring.
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
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.
Added two new tasks to query the forward and reverse limits to see if they're triggered or not.
Description
Added two new tasks to query the forward and reverse limits to see if they're triggered or not. The argument can be any axis. (e.g. Axis "A" for motor A).
Motivation and Context
We ran into a new issue at site with the limit switches bouncing where they were flickering. We added capacitors in the electronics to try and debounce the limit switches, but were not able to check the state of the limits without the new tasks. Now we can query those forward and reverse limits to see if they're triggered or not.
How Has This Been Tested?
Tested the limits for the lead axes "A" and "C" in a script and they worked.
Types of changes
Checklist:
I think the documentation would need to be updated if a new task is added, but I'm unsure, but I can add that later if that's needed.