Skip to content
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

cleanup gripper agent #487

Merged
merged 72 commits into from
Sep 29, 2023
Merged

cleanup gripper agent #487

merged 72 commits into from
Sep 29, 2023

Conversation

jlashner
Copy link
Collaborator

@jlashner jlashner commented Jul 31, 2023

A few changes to the gripper-agent to address some things mentioned by Brian in the PR comments and to make it more compatible with the PRU monitor sobonelib changes.

This needs testing

@jlashner jlashner requested a review from bbixler500 July 31, 2023 18:15
chill90 and others added 29 commits August 10, 2023 15:06
… scheme. Agent interfaces with a beaglebone microcontroller to perform functions. File src/gripper_server.py and files located in the pru/ directory will be moved to the beaglebone home directory. During operation two beaglebone processes will be ongoing. One process in the "src" directory "python3 gripper_server.py" and one process in the "pru" directory "sudo ./run.sh". The "src" process sets up a server to receive control commands from the agent. The "pru" process continually sends the agent encoder and limit switch data packets. The compiled code is included along with the uncompiled C code.
…isor agent. Rearranged structure of agent processes to better utilize the OCS framework. Added two files in the pru directory which were accidentally missing.
@BrianJKoopman BrianJKoopman mentioned this pull request Aug 23, 2023
7 tasks
@BrianJKoopman BrianJKoopman requested review from BrianJKoopman and removed request for BrianJKoopman August 23, 2023 18:35
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

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

Thanks for the structure clean up effort @jlashner! I mostly have documentation requests.

I feel pretty strongly about the need to have examples of the session.data in the docstrings, but the structure here of passing whatever comes back from the GripperServer in sobonelib straight to session.data makes that perhaps a bit awkward since changes in sobonelib might result in changes in the returned data structure that are documented here.

EDIT: Oh, and please resolve the test failure and pre-commit warnings.

socs/agents/hwp_gripper/agent.py Outdated Show resolved Hide resolved
docs/agents/hwp_gripper.rst Outdated Show resolved Hide resolved
docs/agents/hwp_gripper.rst Outdated Show resolved Hide resolved
docs/agents/hwp_gripper.rst Outdated Show resolved Hide resolved
socs/agents/hwp_gripper/agent.py Outdated Show resolved Hide resolved
socs/agents/hwp_gripper/agent.py Show resolved Hide resolved
socs/agents/hwp_gripper/agent.py Outdated Show resolved Hide resolved
socs/agents/hwp_supervisor/agent.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
socs/agents/hwp_supervisor/agent.py Outdated Show resolved Hide resolved
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all those comments @bbixler500. There's still one missing session.data example (I left the comment unresolved in the last review.) And also there's the mock that's still causing issues build the docs. Lastly, there are still a failing test, it looks related to the ibootbar states.

socs/agents/hwp_gripper/agent.py Outdated Show resolved Hide resolved
@BrianJKoopman
Copy link
Member

Let me know if I can help with the tests. Everything else looks good.

Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the tests!

@BrianJKoopman BrianJKoopman merged commit 147149e into main Sep 29, 2023
4 checks passed
@BrianJKoopman BrianJKoopman deleted the gripper_agent_cleanup branch September 29, 2023 21:18
hnakata-JP pushed a commit that referenced this pull request Apr 12, 2024
* Created hwp gripper agent

* Updates from comments

* Removed unused import

* Uncommented input decorators

* Protect local src imports when building docs

* Fix permissions on Dockerfile

* Added and modified files to account for the change in gripper control scheme. Agent interfaces with a beaglebone microcontroller to perform functions. File src/gripper_server.py and files located in the pru/ directory will be moved to the beaglebone home directory. During operation two beaglebone processes will be ongoing. One process in the "src" directory "python3 gripper_server.py" and one process in the "pru" directory "sudo ./run.sh". The "src" process sets up a server to receive control commands from the agent. The "pru" process continually sends the agent encoder and limit switch data packets. The compiled code is included along with the uncompiled C code.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changes to make the agent work in the SAT1 setup. Still WIP

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added energency shutdown functionality by interfacing with the supervisor agent. Rearranged structure of agent processes to better utilize the OCS framework. Added two files in the pru directory which were accidentally missing.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed files unrelated to OCS and moved them into the "simonsobs/sobonelib" repository

* Changes for socs update compatibility

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* small change

* Remove dockerfile

* Removed unused imports and variables

* Added hwp_gripper.rst file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed more unused imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added docstrings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moved control commands from agent.py into drivers/gripper_client.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added additional comments to explain the purpose of certain variables

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix syntax error

* Fix Gripper docs page builds

* Mock supervisor agent imports for docs builds

* Add hwp gripper agent to docs index

* Changed shutdown procedure to account for changes in supervisor agent

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added additional limit switch functionality and renamed method `grip_mode` to `grip_is_cold`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Simple changes in response to PR

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* minor changes and renames

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changed communication from UDP to TCP and improved logging messages sent to agent

* Combined function of GripperBuilder.py and GripperCollector.py into single file gripper_collector.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updated hwp_gripper.rst

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moved pru packet collection out of the gripper agent and added additional functions to query actuator positions and limit states

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* cleanup gripper agent

and make compatible with PRU monitor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changes to get gripper agent working on sat1

* Changed name of gripper class and fixed typo in supervisor monitor

* Modified shutdown procedure and increased command timeout

* Added monitoring of the bias power supply iboot bar

* Disabled emergency grip procedure. Removed no data shutdown trigger. Added exception handling to state monitor

* fixed typo

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* misc gripper agent updates

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added example session data, and fixed spelling mistakes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added session.data description and changed structure of iboot outlet setting

* trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

* Remove other hwp_supervisor mock

* still trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

---------

Co-authored-by: Charles Hill <[email protected]>
Co-authored-by: Brian Koopman <[email protected]>
Co-authored-by: Bryce Bixler <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kevin Crowley <[email protected]>
Co-authored-by: Kevin Crowley <[email protected]>
Co-authored-by: Bryce Bixler <[email protected]>
BrianJKoopman added a commit that referenced this pull request May 8, 2024
* Created hwp gripper agent

* Updates from comments

* Removed unused import

* Uncommented input decorators

* Protect local src imports when building docs

* Fix permissions on Dockerfile

* Added and modified files to account for the change in gripper control scheme. Agent interfaces with a beaglebone microcontroller to perform functions. File src/gripper_server.py and files located in the pru/ directory will be moved to the beaglebone home directory. During operation two beaglebone processes will be ongoing. One process in the "src" directory "python3 gripper_server.py" and one process in the "pru" directory "sudo ./run.sh". The "src" process sets up a server to receive control commands from the agent. The "pru" process continually sends the agent encoder and limit switch data packets. The compiled code is included along with the uncompiled C code.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changes to make the agent work in the SAT1 setup. Still WIP

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added energency shutdown functionality by interfacing with the supervisor agent. Rearranged structure of agent processes to better utilize the OCS framework. Added two files in the pru directory which were accidentally missing.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed files unrelated to OCS and moved them into the "simonsobs/sobonelib" repository

* Changes for socs update compatibility

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* small change

* Remove dockerfile

* Removed unused imports and variables

* Added hwp_gripper.rst file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed more unused imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added docstrings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moved control commands from agent.py into drivers/gripper_client.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added additional comments to explain the purpose of certain variables

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix syntax error

* Fix Gripper docs page builds

* Mock supervisor agent imports for docs builds

* Add hwp gripper agent to docs index

* Changed shutdown procedure to account for changes in supervisor agent

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added additional limit switch functionality and renamed method `grip_mode` to `grip_is_cold`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Simple changes in response to PR

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* minor changes and renames

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changed communication from UDP to TCP and improved logging messages sent to agent

* Combined function of GripperBuilder.py and GripperCollector.py into single file gripper_collector.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updated hwp_gripper.rst

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moved pru packet collection out of the gripper agent and added additional functions to query actuator positions and limit states

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* cleanup gripper agent

and make compatible with PRU monitor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changes to get gripper agent working on sat1

* Changed name of gripper class and fixed typo in supervisor monitor

* Modified shutdown procedure and increased command timeout

* Added monitoring of the bias power supply iboot bar

* Disabled emergency grip procedure. Removed no data shutdown trigger. Added exception handling to state monitor

* fixed typo

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* misc gripper agent updates

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added example session data, and fixed spelling mistakes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added session.data description and changed structure of iboot outlet setting

* trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

* Remove other hwp_supervisor mock

* still trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

* still trying to fix unit test

---------

Co-authored-by: Charles Hill <[email protected]>
Co-authored-by: Brian Koopman <[email protected]>
Co-authored-by: Bryce Bixler <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kevin Crowley <[email protected]>
Co-authored-by: Kevin Crowley <[email protected]>
Co-authored-by: Bryce Bixler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants