-
Notifications
You must be signed in to change notification settings - Fork 14
Galil3 - Added limit switch query task to agent.py and drivers.py #960
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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
davidvng
left a comment
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.
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): |
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.
| 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})" |
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.
| 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})" |
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.
| 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})") |
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.