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

Clean rewrite of the driver in Python #13

Draft
wants to merge 72 commits into
base: main
Choose a base branch
from
Draft

Conversation

stefanscherzinger
Copy link
Member

@stefanscherzinger stefanscherzinger commented Feb 13, 2025

Features

  • Driver library with SCHUNK protocol-related operations
  • Modbus support
  • TCP/IP support
  • Thin ROS2 wrapper

Goals:
- Use everything that we leaned in the C++ version and build a new
  driver in Python
- Use topics and services only (drop actions) to increase compatibility
  with other frameworks
- Use a `lifecycle node` to provide more control over the driver's state
- Support both TCP/IP and Modbus RTU grippers
- Write clean and well tested functionality
This should make sure that all test nodes find each other.
This focusses the CI on the python driver.
@stefanscherzinger stefanscherzinger force-pushed the develop branch 7 times, most recently from 2e1cad8 to d53065f Compare February 13, 2025 14:25
Steps:
- Add missing python dependencies
- Drop the `IRON` workflows. That's EOL by now.
- Fix `mypy` warnings for duplicate modules
- Fix the setup fixture. That would require a sourced environment
That's no longer needed with the top-level `__init__.py` file.
That's needed now with the top-level `__init__.py` file from the last
commit.
We make `driver.py` executable instead.
Without this, `ros2 launch ..` failed with not finding additional python
dependencies from virtual environments

Not sure if this is the way to go, though..
@stefanscherzinger stefanscherzinger force-pushed the develop branch 5 times, most recently from 94b60d8 to 7eeb6a7 Compare February 17, 2025 18:38
Also add boilerplate code for the `acknowledge` and the `fast_stop`
services.
They are only exposed in a configured driver.
Also add two tracing functions what we actually send for debugging.
This will provide low-level communication and data handling between
Modbus RTU and Ethernet-based SCHUNK grippers.

This will keep the ROS2 driver lean and simple.
stefanscherzinger and others added 30 commits March 1, 2025 17:04
We now support repeated connects and disconnects.
We now check if the driver's lifecycle interface is up.
That's more robust.
Also add a test for checking the driver's advertised services.
Use a skip decorator when no gripper (simulator) is available.
This will be handy for the ROS2 driver's service result messages.
Also rename the error, warning, and additional codes.
This is more aligned with the documentation.
We might need a status check later so see if the acknowledge request
actually worked.
This was missing from commit 9a9f4b4
Those are straight-forward to search in SCHUNK's manuals and avoid
confusion with decimal codes.
Pymodbus uses big endian internally for encoding and decoding, so we
need to stick to this.
Also add a bunch of logging.
Let's see if this works on PSX.
We now wait for the correct status bits to report success.
This now works with the BKS simulator.
Add a proof-of-concept Modbus RTU ROS2 wrapper
Users of the library shouldn't take care of these details.
Future commits will also add more high-level functionality for the
gripper's features.
We needed to adjust some tests and now require the BKS simulator for
most communication-related testing.
That's a better usage of system resources.
We'll call this in every high-level function.
This leads to less code and is the common practice with SCHUNK modules.
We'll use this in all high-level functions.
That's now in line with the rest of the bit operations.
All of these high-level api functions will wrap bit-related operations
and module interaction as good as possible.
This will lead to a thin ROS2 driver wrapper.
This is now as thin as we want it.
Also drop receiving the module's state periodically in the driver.
The library does that now.
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.

2 participants